labeled_curves: Plot labeled curves

View source: R/glm.R

labeled_curvesR Documentation

Plot labeled curves

Description

Draws multiple curves, each with a properly-placed label and unique color/linestyle.

Usage

labeled_curves(
  x,
  y,
  se = NULL,
  labels,
  xtick = names(x),
  xlab = NULL,
  ylab,
  type = "o",
  group,
  color.palette = default.colors(6),
  col,
  lty.palette = 1:6,
  lty,
  lwd = 2,
  jitter = 0,
  legend. = NULL,
  move = T,
  dryrun = F,
  cex = 1,
  horizontal = F,
  mar,
  bg = par("bg"),
  ylim,
  main = "",
  xaxt = par("xaxt"),
  yaxt = par("yaxt"),
  ...
)

Arguments

x

a numeric vector giving the horizontal position of each point.

y

a matrix or data frame giving the vertical position of each point. Each column defines one curve.

se

a matrix or data frame, the same size as y, giving an error bound on each value.

labels

a character vector of labels for the lines. Defaults to the column names of y.

xlab, ylab

axis labels, by default the dimnames of y.

type

indicates whether to draw points, lines, or both. See plot.

group

a numeric vector specifying how to group cases when assigning colors.

color.palette

a vector of colors, arbitrary length, or a function with integer argument which generates a vector of colors. Used if col is not specified. If shorter than the number of curves, colors will be recycled and the line style will change.

col

a vector of colors, as in a call to plot. Used to explicitly set the color of each curve.

lty.palette

a vector of line styles, arbitrary length. The line style will rotate through these when there aren't enough colors.

lty

a vector of line styles, as in a call to plot. Used to explicitly set the style of each curve.

lwd

line width.

jitter

the amount by which to jitter the error bars, to avoid overplotting. jitter=0.02 is usually sufficient.

cex

character expansion factor.

horizontal

If TRUE, the axes are laid out horizontally, so that the curves run vertically.

mar

a numerical vector giving the lines of margin on the four sides of the plot (see par). If missing, it is set according to auto.mar.

bg

background color.

ylim

desired plotting limits.

main

title for the plot.

...

extra arguments for low-level plotting commands.

legend

If TRUE, the labels are placed in a legend. Otherwise the labels are placed next to the lines.

Details

Point j in curve i is at (x[j],y[j,i]). Thus all curves must be the same length, and have points at the same horizontal positions. If y[i,j]=NA, then the curve has a break at the previous point, and resumes at the next non-NA point.

If se is given, then an error bar will be placed around each point.

Author(s)

Tom Minka

See Also

parallel_plot


paulemms/datamining documentation built on March 1, 2023, 4:01 p.m.