TkRplot               package:tkrplot               R Documentation

_T_k _R_p_l_o_t

_D_e_s_c_r_i_p_t_i_o_n:

     Placing R graphics in a Tk image.

_U_s_a_g_e:

     tkrplot(parent, fun, hscale=1, vscale=1)
     tkrreplot(lab, fun = lab$fun, hscale=lab$hscale, vscale=lab$vscale)
     tkpersp(x,y,z, theta = 30,phi = 30,expand = 0.5, r = sqrt(3), ...)

_A_r_g_u_m_e_n_t_s:

  parent: parent of widget window

     fun: function of no arguments that creates the plot

     lab: a Tk Rplot label widget

  hscale: horizontal scale factor for image size

  vscale: vertical scale factor for image size

       x: as for `persp'

       y: as for `persp'

       z: as for `persp'

   theta: as for `persp'

     phi: as for `persp'

  expand: as for `persp'

       r: as for `persp'

     ...: additional arguments for `persp'

_D_e_t_a_i_l_s:

     The function `tkrplot' creates and returns a Tk label widget
     containing a Tk image of type Rplot.  For now the size is
     hard-wired. The plot is created by calling `fun' with a special
     device used create the image.

     The function `tkrreplot' calls `fun' to place a new plot in the
     Rplot widget `lab'.

     `tkpersp' is called like `persp' but produces a plot in which some
     of the parameters of `persp' are controlled graphically.

_E_x_a_m_p_l_e_s:

     ## These cannot be run by examples() but should be OK when pasted
     ## into an interactive R session with the tcltk package loaded

     tt <- tktoplevel()
     bb<-1
     img <-tkrplot(tt, function() plot(1:20,(1:20)^bb))
     f<-function(...) {
         b <- as.numeric(tclvalue("bb"))
         if (b != bb) {
             bb <<- b
             tkrreplot(img)
         }
     }
     s <- tkscale(tt, command=f, from=0.05, to=2.00, variable="bb",
                  showvalue=FALSE, resolution=0.05, orient="horiz")
     tkpack(img,s)

