[R] exact relative positioning of lattice plots

Deepayan Sarkar deepayan.sarkar at gmail.com
Fri Jun 22 10:48:45 CEST 2012


On Wed, Jun 20, 2012 at 7:18 PM, John G. Bullock <john.bullock at yale.edu> wrote:
>
>> 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 or whatever).
>>
>> If you do have extra annotation, you need to decide how much space
>> they should have.
>
> Thank you.  Yes, my actual use case does have annotations outside the panel.  Even so, this is helpful.

You should be able to specify absolute dimensions for the annotation
elements using ?lattice.options (also settable through the
'lattice.options' argument in xyplot() etc.). For a list of legitimate
component names, see

str(lattice.getOption("layout.heights"), max.level=2)

Each component should be a list of arguments to grid::unit().

Due to a bug this doesn't work properly in the current released
version, but should be fixed in the r-forge version available at

https://r-forge.r-project.org/R/?group_id=638

-Deepayan



More information about the R-help mailing list