Re: [R] Obtaining the true aspect ratio for a lattice plot

2010-03-10 Thread Ryan Hafen
Thanks much - very nice. I hadn't thought of that approach. I dug around in the lattice source and found another way to do it so for what it's worth, I'll post it - maybe it will be useful to someone. Basically, I made a function from code found in plot.trellis() that gets the grid layout

Re: [R] Obtaining the true aspect ratio for a lattice plot

2010-03-09 Thread Felix Andrews
Basically you want to achieve an aspect ratio of 0.5 (say) when specifying aspect = "fill". You can calculate the aspect ratio after a lattice plot has been displayed: currAspect <- function() { trellis.focus("panel", 1, 1, highlight = FALSE) sz <- current.panel.limits("mm") trellis.un

[R] Obtaining the true aspect ratio for a lattice plot

2010-03-09 Thread Ryan Hafen
I almost always supply my own aspect ratio when plotting using lattice. When I plot these to pdf, I would like to specify pdf dimensions that will result in minimal margins around the plot. In my application, resorting to a pdf cropper after plotting is not an option - I must do it in R.