An embedded and charset-unspecified text was scrubbed... Name: not available Url: https://stat.ethz.ch/pipermail/r-help/attachments/20041122/8676cd66/attachment.pl
How to correct this
2 messages · Jin.Li@csiro.au, Sundar Dorai-Raj
Jin.Li at csiro.au wrote:
Hi there, I tried to add a few circles on an existing figure using the following codes grid.circle(x=0.5, y=0.5, r=0.1, draw=TRUE, gp=gpar(col=5)) grid.circle(x=0.5, y=0.5, r=0.3, draw=TRUE, gp=gpar(col=5)) grid.circle(x=0.5, y=0.5, r=0.5, draw=TRUE, gp=gpar(col=5)) points(0.5, 0.5, col = 5) # centre of the circle , but all circles moved away from the centre. Could we do any corrections to this? Thanks. Regards, Jin
If you are using Lattice (where grid is a more natural fit) then you can
do the following:
library(lattice)
library(grid)
xyplot(0.5 ~ 0.5,
panel = function(x, y, ...) {
grid.circle(x, y, 0.5, default.units = "native")
panel.xyplot(x, y, ...)
},
xlim = c(0, 1),
ylim = c(0, 1))
I'm not sure how grid is supposed to behave in a non-trellis.device.
--sundar