plframe {plgraphics}R Documentation

Low level plotting functions for the 'pl' system

Description

These functions set up the frame of a plot based on the 'pl' paradigm

Usage

plframe(x, y, xlab = NULL, ylab = NULL, ticklabels = TRUE, plextext = NULL,
  axcol = rep(1, 4), mar = NULL, 
  plargs = NULL, ploptions = NULL, setpar = TRUE)

pltitle(main=NULL, sub=NULL, cex=NULL, cexmin=NULL, 
  side=3, line=NULL, adj=NULL, outer.margin=NULL, col="black",
  doc=NULL, show=TRUE, plargs=NULL, ploptions = NULL, ...)

plaxis(side, x, lab=TRUE, range=NULL, varlabel=NULL, col=1,
  tickintervals=NULL,
  plargs = NULL, ploptions = NULL, setpar = TRUE, ...) 

Arguments

x

coordinates for the horizontal axis

y

coordinates for the vertical axis

axcol

colors for drawing axes scales

mar

plot margins

xlab, ylab

axis labels

main, sub

main title and subtitle

varlabel

variable name

plextext

extension of the plotting area beyond the possibly already extended range. This helps to accomodate sybmbols.

ticklabels

logical: should tick labels be shown?

side

For pltitle: in which margin should the text be shown?
For plaxis: integer indicating which axis is to be drawn

cex

character size. May be vector of length 3, giving size for main title, subtitle, and tit attribute of title, respectively. The default is given by ploptions("title.cex").

cexmin

minimal character size, to be used to adjust the character size to the length of the text (if cex is NULL)

line

line in margin on which the main title is placed – or the subtitle if main is NULL

adj

text adjustment, scalar between 0 and 1

outer.margin

logical: should title text be placed in outer margin?

col

color for the title text or axis line and tickmarks

lab

logical: should labels for tickmarks be displayed?

range

range in which tickmarks are set

doc

logical: should the tit attribute of main be displayed if available?

show

logical: if FALSE, nothing will be done if there are multiple frames and the current one is not the first. If it is negative, no title will be shown, but the value will be returned.

tickintervals

number of intervals used by pretty to determine the axis ticks.

plargs, ploptions

result of pl.control, see Details

setpar

logical: should graphical parameters cex, mar, mgp be set according to ploptions?

...

absorbs extra arguments

Details

plframe draws axes according to argument axes, by calling plaxis. It looks for attributes of x and y, such as innerrange and ticksat. Tick labels are shown at the values of the ticklabelsat attribute if available, otherwise at the values of ticksat. The labels can be given by the attribute ticklabels. This facilitates setting more tick marks than labels, see the example.
It also draws a grid. The positions of gridlines at ticksat by default.
Finally, it draws "zero" lines as determined by the pl option zeroline. The latter can be a numeric vector giving the positions of such threshold lines, or a list of two such vectors, the first for horizontal axis, the second for the vertical axis.

plargs and ploptions may be specified explicitly, but they are usually generated by calling pl.control.

Value

plframe and plaxis invisibly return the former par(c("cex", "mar", "mgp")) if setpar is TRUE, otherwise NULL.

Author(s)

Werner A. Stahel

See Also

gendateaxis; pl.control

Examples

plyx(Sepal.Width ~ Sepal.Length, data=iris)

## again, each step separately
t.dt <- .plargs$pldata
ploptions(grid=TRUE)
oldpar <- plframe(t.dt$Sepal.Length, t.dt$Sepal.Width, plargs=.plargs)
plsmooth(t.dt$Sepal.Length, t.dt$Sepal.Width, plargs=.plargs)
t.plab <- plmark(t.dt$Sepal.Length, t.dt$Sepal.Width, markextremes=0.03,
                 plargs=.plargs)
plpoints(t.dt$Sepal.Length, t.dt$Sepal.Width, plargs=.plargs, plab=t.plab) 
par(oldpar)   ## reset the changed graphical parameters

[Package plgraphics version 1.0 Index]