plotsize.default: Determine Plot Size by Default

Description Usage Arguments Value See Also Examples

View source: R/default.R

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

1
2
3
4
## 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

round result to this many decimal places

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 pdf

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

1
2
3
4
5
options(ask.default = FALSE)
options(device.ask.default = FALSE)
library(lattice)
p <- xyplot(2~3)
plotsize(p, width = 7, height = 7)

plotscale documentation built on May 2, 2019, 6:50 a.m.