Learn R Programming

lattice (version 0.3-1)

splom: Scatter Plot Matrices

Description

Draw scatter plot matrices

Usage

splom(formula,
      aspect = 1,
      between = list(x = 0.5, y = 0.5),
      panel = panel.splom,
      superpanel = panel.pairs,
      pscales = 5,
      varnames, ...)

Arguments

formula
a formula describing the form of the plot. A formula of the form ~ x | g1 * g2 * ..., where x is a matrix with p columns, with rows giving the variables of which the pairwise scatterplots will be produced, conditiona
aspect
aspect ratio of each panel (and subpanel), square by default.
between
to avoid confusion between panels and subpanels, the default is to show the panels of a splom plot with space between them.
panel
function that is used to plot the data on each subpanel of a splom display.
superpanel
function that sets up the splom display, by default as a scatterplot matrix.
pscales
a numeric value or a list. If pscales is a single number, it tells the approximate number of equally-spaced ticks that should appear on each axis. If pscales is a list, it should have p components, each of which is itself a list with two comp
varnames
character vector giving the names of the p variables in x. By default, the column names of x.
...
other arguments

Value

  • An object of class ``trellis'', plotted by default by print.trellis.

synopsis

splom(formula, data = parent.frame(), aspect = 1, between = list(x = 0.5, y = 0.5), layout = NULL, panel = panel.xyplot, prepanel = NULL, scales = list(), strip = TRUE, groups = NULL, xlab = "Scatter Plot Matrix", xlim, ylab = NULL, ylim, superpanel = panel.pairs, pscales = 5, varnames, ..., subscripts = !is.null(groups), subset = TRUE)

Details

see the documentation for trellis.args

The scales argument does not have its ususal interpretation. Its function is partly served by pscales. However, components of scale which are sensible would be supported (in future if not already supported). The rot component should be specified as a vector of length 2 for the labels of the horizontal and vertical labels respectively.

See Also

trellis.args, Lattice

Examples

Run this code
data(iris)
super.sym <- trellis.par.get("superpose.symbol")
splom(~iris[1:4], groups = Species, data = iris,
      panel = panel.superpose,
      key = list(title = "Three Varieties of Iris",
                 columns = 3, 
                 points = list(pch = super.sym$pch[1:3],
                 col = super.sym$col[1:3]),
                 text = list(c("Setosa", "Versicolor", "Virginica"))))
splom(~iris[1:3]|Species, data = iris, 
      layout=c(2,2), pscales = 0,
      varnames = c("Sepal
Length", "Sepal
Width", "Petal
Length"),
      page = function(...) {
          grid.text(x = seq(.6, .8, len = 4), 
                    y = seq(.9, .6, len = 4), 
                    label = c("Three", "Varieties", "of", "Iris"),
                    gp = gpar(fontsize=20))
      })

Run the code above in your browser using DataLab