MAJOR=4
MINOR=21
DEVNAME=tty21
     ˆÊÉÏ665Å¾Í ™    ‹      ÕWßoÚ0~ï_áùaoÉñ««FC¦ŽTZˆ2MÓ´c;Äj°#Û”±¿~&-›@­êà…»„Ï¾ï»;Ûqô&tÇß†×èÓøö¿|¼éu ¾6» É8ñ´ÂZàº�Î¬-Ú ‹Å"\4C¥§0AfgyŒÕ‚Ú�Y†ã³¨|Ÿ¡(ã„9‹"+lÎãždü'R)5·F0îf.æ“\Ðê053`¸d©ÈyÈøL…™	©R…Ä5�1y…nA¡›i'0<O�.˜¥�™bóœÉ¨ˆÀGw|`M(š(¶,yÖÿ'z•2YQ+]G6C$SÙÁV8ŽÄlŠŒ¦‚*i`’yNEŠÉmïu?Î,GÇA.rÚÁº�þå “à¸Of<²së0W8¾!Æ"ÇO¤‚³�à;¾¿vO˜xLÂÕ¢°BÉ'(8‰›R©ÊMAœÖs§ Ó›(aÏeƒÐ?’1¼]÷ÇIoäSÂÊ)žØ½Z…q<$šK‹¡9µJ/×9ð„ÞÊ‰).«G´V¨Å4³8F(@[‘¤e.ï¥ZÈÍÌ¸¬oÍ	UšWOWÞ&Õ¿¸5j�wA½Ôê¨~Ñn5Út{Æç‘ªœq½©aW]™\—öÊÛGCÕÞ·Ïwkx‰Bì¯![!K•w,h&!…õÍTy/!â%šéP–ØJEé>+£4k«5qq$kB*ËËnòöXziþÑîØ²~Il<‹’ÊýPéÂz{zÛ«qG˜(‡àøÑ=Á2¸aåÙàè;�þ	nP–ˆ²�VæéÏù/ù{{,;ë»èÕZhÏOfX_&"X]o"ð×°ßîûÅÊé    6   ˆl–Ãa¾”Ê:”Ê�rãOÜªbÑ¿�þBÓ„Y¹ER6:ÉüÿÑƒlB{Ð¿Î l    ###
### This demonstration script creates a canvas widget showing a 2-D
### plot with data points that can be dragged with the mouse.
###
### It is a ripoff of the plot.tcl demo from the tk 8.0 distribution
### All I did was to add the code to plot the fitted regression line.

#  Copyright (C) 2000-2008 The R Core Team

require(tcltk) || stop("tcl/tk library not available")
require(graphics); require(stats)
local({
    have_ttk <- as.character(tcl("info", "tclversion")) >= "8.5"
    if(have_ttk) {
        tkbutton <- ttkbutton
        tkframe <- ttkframe
        tklabel <- ttklabel
    }
    tclServiceMode(FALSE) # don't display until complete
    top <- tktoplevel()
    tktitle(top) <- "Plot Demonstration"

    msg <- tklabel(top,
                   font="helvetica",
                   wraplength="4i",
                   justify="left",
                   text="This window displays a canvas widget containing a simple 2-dimensional plot.  You can doctor the data by dragging any of the points with mouse button 1.")

    tkpack(msg, side="top")

    buttons <- tkframe(top)
    tkpack(buttons, side="bottom", fill="x", pady="2m")
    dismiss <- tkbutton(buttons, text="Dismiss",
                        command=function()tkdestroy(top))
    tkpack(dismiss, side="left", expand=TRUE)

    canvas <- tkcanvas(top, relief="raised", width=450, height=300)
    tkpack(canvas, side="top", fill="x")

    plotFont <- "Helvetica 18"

    tkcreate(canvas, "line", 100, 250, 400, 250, width=2)
    tkcreate(canvas, "line", 100, 250, 100, 50, width=2)
    tkcreate(canvas, "text", 225, 20, text="A Simple Plot",
             font=plotFont, fill="brown")

    # X tickmarks & labels
    for (i in 0:10) {
        x <- 100 + i * 30
        tkcreate(canvas, "line", x, 250, x, 245, width=2)
        tkcreate(canvas, "text", x, 254,
                 text=10*i, anchor="n", font=plotFont)
    }
    # Y tickmarks & labels
    for (i in 0:5) {
        y <- 250 - i * 40
        tkcreate(canvas, "line", 100, y, 105, y, width=2)
        tkcreate(canvas, "text", 96, y,
                 text=formatC(50*i,format="f",digits=1),
                 anchor="e", font=plotFont)
    }

    # The (original) data
    points <- matrix(c(12, 56,
                       20, 94,
                       33, 98,
                       32, 120,
                       61, 180,
                       75, 160,
                       98, 223), ncol=2, byrow=TRUE)

    ## `self-drawing' point object
    point.items <- apply(points, 1, function(row) {
        x <- 100 + 3 * row[1]
        y <- 250 - 4/5 * row[2]
        item <- tkcreate(canvas, "oval", x - 6, y - 6, x + 6, y + 6,
                         width=1, outline="black",
                         fill="SkyBlue2")
        tkaddtag(canvas, "point", "withtag", item)
        item
    })

    plotDown <- function(x, y) {
      ## This procedure is invoked when the mouse is pressed over one
      ## of the data points.  It sets up state to allow the point
      ## to be dragged.
      ##
      ## Arguments:
      ## x, y -	The coordinates of the mouse press.
      x <- as.numeric(x)
      y <- as.numeric(y)
      tkdtag(canvas, "selected")
      tkaddtag(canvas, "selected", "withtag", "current")
      tkitemraise(canvas,"current")
      lastX <<- x
    