plotsize.default {plotscale} | R Documentation |
Determine Plot Size by Default
Description
Determines the size of a grid graphics plot conditional on device dimensions.
Size is defined as physical width and height in inches
of the first encountered panel as rendered on a device with the
specified width and height. pdf()
is used as the evaluation
device. 'First encountered panel' is resolved by evaluating the
output of a call to current.vpTree
for the
first viewport name containing 'panel' or 'subpanel'. The latter
takes precedence if available, for intuitive handling of output from
splom
.
Usage
## Default S3 method:
plotsize(x, width, height,
digits = getOption("plotscale_plotsize_digits", 3),
pattern = c("subpanel\\b", "panel\\b"), index = 1, ...)
Arguments
x |
object |
width |
device width in inches |
height |
device height in inches |
digits |
|
pattern |
character: vector of search patterns to identify critical viewport set; first non-empty set is retained |
index |
integer: select this element of the critical viewport set |
... |
other arguments passed to |
Value
length 2 named list giving width and height in inches (class 'size') for the first panel
See Also
Other plotsize: as.size
,
plotsize
, print.size
Examples
options(ask.default = FALSE)
options(device.ask.default = FALSE)
library(lattice)
p <- xyplot(2~3)
plotsize(p, width = 7, height = 7)