zoom: Zoom

View source: R/zoom.R

zoomR Documentation

Zoom

Description

Change text size in a lattice plot.

Usage

zoom(x, ...)

## S3 method for class 'trellis'
zoom(x, size = 1, main = 1.2 * size, lab = size,
  axis = size, strip = size, sub = 0.9 * size, legend = 0.9 * size,
  splom = 0.9 * size, ...)

Arguments

x

a lattice plot of class "trellis".

...

further arguments, currently ignored.

size

text size multiplier.

main

size of main title (default is 1.2 * size).

lab

size of axis labels (default is size).

axis

size of tick labels (default is size).

strip

size of strip labels (default is size).

sub

size of subtitle (default is 0.9 * size).

legend

size of legend labels (default is 0.9 * size).

splom

size of scatterplot matrix diagonal labels (default is 0.9 * size).

Details

Pass NULL for any argument to avoid changing the size of that text component.

The legend component of a lattice plot can be somewhat fickle, as the object structure varies between plots. One solution is to pass legend = NULL and tweak the legend before or after calling the zoom function.

Value

The same lattice object, but with altered text size.

Note

The default values result in lattice plots that have similar text size as base plots, when using taf.png.

This function ends with a print call, to make it easy to export the lattice plot to a file, without the need of an explicit print.

See Also

Lattice plots are created using xyplot or related functions.

taf.png opens a PNG graphics device.

TAF-package gives an overview of the package.

Examples

library(lattice)

xyplot(1~1)
zoom(xyplot(1~1))
zoom(xyplot(1~1), size=1.2)
zoom(xyplot(1~1), axis=0.8)
zoom(xyplot(1~1), axis=NULL)

## Not run: 
taf.png("myplot")
plot(1)
dev.off()

taf.png("mytrellis")
xyplot(1~1)
dev.off()

taf.png("mytrellis_zoom")
zoom(xyplot(1~1))
dev.off()

## End(Not run)


TAF documentation built on March 31, 2023, 6:51 p.m.