[R] grid.grab(): strange behavior of "wrap" argument when working with lattice output

2018-10-30 Thread John G. Bullock
grid.grab() captures all of the current viewports and stores them as a grob. In theory, and often in practice, you can use grid.grab() to store an image now for drawing later on. But I have noticed some odd behavior of grid.grab() when working with lattice output. It is all related to the wra

Re: [R] centering text across panels of an annotated lattice figure

2013-08-30 Thread John G. Bullock
>> I have a multi-panel lattice figure. It has an even number of >> equal-width columns. I would like to center text across the columns. >> >> The xlab argument often handles this job nicely. But I want a more >> flexible solution. (I have many strings and want to position them at >> different heig

[R] centering text across panels of an annotated lattice figure

2013-08-25 Thread John G. Bullock
I have a multi-panel lattice figure. It has an even number of equal-width columns. I would like to center text across the columns. The xlab argument often handles this job nicely. But I want a more flexible solution. (I have many strings and want to position them at different heights, but alwa

Re: [R] exact relative positioning of lattice plots

2012-06-20 Thread John G. Bullock
> In your actual use case, are there any annotations outside the panel > (tick marks, labels, etc.)? Things would be much simpler if not (as in > your example). In that case, just call the suitable panel function > after setting up the proper axis limits (after doing pushViewport or > seekViewport

[R] exact relative positioning of lattice plots

2012-06-20 Thread John G. Bullock
Hello, I have two lattice plots for which panel.height is fixed. I am trying to position them in a column so that there is exactly half an inch of vertical space between them. This would be a simple task if I were not fixing panel.height. But given that I am, I can't find a way to put exact

Re: [R] lattice: drawing strips for single-panel plots

2011-03-05 Thread John G. Bullock
The strip argument to panel.xyplot seems to be ignored for single-panel plots. The workaround is to give it a one-level factor: library(lattice) data(Chem97, package = "mlmRev") Chem97$what = as.factor("strip text") densityplot(~ gcsescore|what, data = Chem97) Thank you. That works. Jo

[R] lattice: drawing strips for single-panel plots

2011-03-04 Thread John G. Bullock
The strip argument to panel.xyplot seems to be ignored for single-panel plots. Here is an example: data(Chem97, package = "mlmRev") myStrip <- function(...) { ltext(.5, .5, 'strip text') } densityplot(~ gcsescore, data = Chem97, strip=myStrip) The figure is printed with no strip. The

[R] lattice, Hmisc: vertical placement of superpose.symbol in Dotplot()

2009-07-03 Thread John G. Bullock
I often use Dotplot() from the Hmisc package to construct dotplots. Typically, I plot multiple symbols on each line of a dotplot. Sometimes these symbols overlap. In these cases, I would like to eliminate the overlap by slightly adjusting the vertical placement of the plotted symbols. Is there

[R] lattice: axes drawn when relation='free' or relation='sliced' but not when relation='same'

2007-12-19 Thread John G. Bullock
I'm using lattice to draw a multi-panel figure: 5 rows, 4 columns. The y-axis for each panel is determined by yaxs<- list(draw=T , labels=c(0, '.5', '1', '1.5') , at=c(0, .5, 1, 1.5) , tck=c(.4, 0)

Re: [R] lattice: placing y-axis labels on right-hand side of panel when relation="sliced"

2007-12-10 Thread John G. Bullock
>I'm using lattice to create a multi-panel figure. I would like > to draw each panel's y-axis ticks and labels on the right-hand > side of the panel. Ordinarily, I would do this by specifying > scales=list(y=list(draw=T, alternating=2)). But in this case, I am > using relation="sliced"

[R] lattice: placing y-axis labels on right-hand side of panel when relation="sliced"

2007-12-09 Thread John G. Bullock
Hello, I'm using lattice to create a multi-panel figure. I would like to draw each panel's y-axis ticks and labels on the right-hand side of the panel. Ordinarily, I would do this by specifying scales=list(y=list(draw=T, alternating=2)). But in this case, I am using relation="sliced" t