Re: [R] grid.edit problem

From: Gabor Grothendieck <ggrothendieck_at_gmail.com>
Date: Sun 16 Oct 2005 - 02:32:36 EST

Sorry, forgot to mention my system:

> R.version.string # XP
[1] "R version 2.2.0, 2005-09-20"

On 10/15/05, Gabor Grothendieck <ggrothendieck@gmail.com> wrote:
> I am having a problem in editing a grob. It works ok if I try to
> shift the grob using npc coordinates but if I do the same thing
> using native coordinates the grob disappears. What is wrong?
>
>
> library(grid)
> grid.newpage()
>
> # create viewport
> pushViewport(viewport(xscale = c(100,200), name = "X"))
>
> # draw vertical line
> grid.lines(150, 0:1, default.units = "native", name = "L")
>
> # move line 25% of the way to the right. Works ok.
> grid.edit("L", x = grid.get("L")$x + unit(0.25, "npc"))
>
>
> # but now repeat it shifting it using native coordinates
> ########################################################
>
> # remove line and draw a new line where the original one was
> grid.remove("L")
> grid.lines(150, 0:1, default.units = "native", name = "L")
>
> # move line 25% of the way to the right but use native coordiantes
> #### line disappears !!!!!!!!!
> grid.edit("L", x = grid.get("L")$x + unit(25, "native"))
>



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Sun Oct 16 02:37:13 2005

This archive was generated by hypermail 2.1.8 : Sun 23 Oct 2005 - 18:55:35 EST