Displaying 8 results from an estimated 8 matches for "pointsgrob".
2009 Jan 21
1
Can I add a point to a pointsGrob from an xyplot without redrawing ?
Hi:
I am a newbie using grid and lattice.
I want to update a xyplot without redrawing and I was wondering if there is
a way of adding a point to a pointsGrob ?
For example, take the example from the "R Graphics Book" page 218-219:
grid.newpage()
angle <- seq(0, 2*pi, length=21)[-21]
x <- cos(angle)
y <- sin(angle)
xyplot( y ~ x, aspect = 1)
Lets say I take the pointsGrob below:
getNames()
[1] "GRID.rect.748" "...
2007 Feb 12
1
Width of a plotting point (in inches) in grid package
Hello,
I'm trying to determine the width of a plotting point (in inches) in the
grid package. I naively thought I could create a pointsGrob with only one
point and get the width (as tried below), but this results in an object with
a size of 0inches (changing cex has no effect). Does anyone have a better
approach? Of course, it would be dependent upon the graphics parameters and
viewport...
Thanks,
Randy
> library(grid)
> pushV...
2009 May 21
1
size of point symbols
...inst a square of 10mm x 10mm.
> checkOneSymbol <- function(pch=0){
> gTree(children=gList(
> rectGrob(0.5, 0.5, width=unit(10, "mm"), height=unit(10,
> "mm"),
> gp=gpar(lty=2, fill=NA, col=alpha("black", 0.5))),
> pointsGrob(0.5, 0.5, size=unit(10, "mm"),pch=pch,
> gp=gpar(col=alpha("red", 0.5)))
> ))
>
> }
> all.symbols <- lapply(0:23, checkOneSymbol)
>
> pdf("symbols.pdf", height=1.2/2.54, width=24.2/2.54)
>
> vp <- viewport(width=0.5, height=...
2009 May 21
1
size of point symbols
...inst a square of 10mm x 10mm.
> checkOneSymbol <- function(pch=0){
> gTree(children=gList(
> rectGrob(0.5, 0.5, width=unit(10, "mm"), height=unit(10,
> "mm"),
> gp=gpar(lty=2, fill=NA, col=alpha("black", 0.5))),
> pointsGrob(0.5, 0.5, size=unit(10, "mm"),pch=pch,
> gp=gpar(col=alpha("red", 0.5)))
> ))
>
> }
> all.symbols <- lapply(0:23, checkOneSymbol)
>
> pdf("symbols.pdf", height=1.2/2.54, width=24.2/2.54)
>
> vp <- viewport(width=0.5, height=...
2005 May 20
2
Lattice: it seems, a bug in draw.key function
...key' components is 'divide', which defines a number of
points on the each line of the legend. The default is 3 points.
I would like a single point, so I set divide = 1.
Call to xyplot didn't produce any points at all.
The body of draw.key function contains the following
pointsGrob(x=(1:key$divide-1)/(key$divide-1), y=rep(0.5,key$divide),
[skip]
)
When key$divide=1, x is NaN...
--
Best regards
Wladimir Eremeev mailto:wl at eimb.ru
==========================================================================
R...
2005 Apr 14
2
Legend in xyplot two columns
Dear R-Help
I have some trouble to set the legend in a xyplot into two rows.
The code below gives me the legend in the layout I am looking for, I
just rather have it in two rows.
library(lattice)
schluessel <- list(
points=list( col="red", pch=19, cex=0.5 ),
text=list(lab="John"),
lines=list(col="blue"),
2009 Jun 04
0
type = 'b' with Grid
Dear all,
I feel like I've been reinventing the wheel with this code (implementing
type = 'b' for Grid graphics),
http://econum.umh.ac.be/rwiki/doku.php?id=tips:graphics-grid:linesandpointsgrob
Has anyone here attempted this with success before? I found suggestions
of overlapping large white points to mask the lines but it's not ideal.
I welcome any comments on the code. (e.g., should it perhaps use
polylines rather than segments?, is there an obvious optimization to
make?, ...)...
2008 Jun 16
1
sizing non-vector point shapes in ggplot2
Dear all,
With normal plotting, one can size a set of points in a plot using a vector
argument to cex in the points() function. This works whether you are using
one of the standard R symbols (i.e. 19+) or some ascii symbol, such as '/'
eg:
plot(1:10, 1:10, type='n');
points(1:10, 1:10, cex = 1:10, pch = '/')
Trying to make the transition to ggplot2, I find that the