[R] grid.edit problem

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


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:34:42 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:40:45 EST