gplot: Generic X-Y plotting

View source: R/gplots.R

gplotR Documentation

Generic X-Y plotting

Description

Generic plotting for R objects with default grid background. For simple scatter plots, plot.default will be used. However, there are plot methods for many R objects including functions, data.frames, density objects, etc. Use methods(gplot) and the documentation for these.

Usage

gplot(x, y, ...)

## Default S3 method:
gplot(x, y = NULL, type = "p", xlim = NULL,
  ylim = NULL, log = "", main = NULL, sub = NULL, xlab = NULL,
  ylab = NULL, ann = par("ann"), axes = TRUE, frame.plot = axes,
  panel.first = NULL, panel.last = NULL, asp = NA, ..., grid = TRUE,
  bty = "n", col.grid = "grey90", col.acc = "white",
  col.axis = "grey50", col.ticks = col.axis)

## S3 method for class 'data.frame'
gplot(x, grid = TRUE, col.grid = "grey90",
  col.acc = "white", ...)

Arguments

x

the coordinates of points in the plot. Alternatively, a single plotting structure, function or any R object with a plot method can be provided.

y

the y coordinates of points in the plot, optional if x is an appropriate structure.

...

Arguments to be passed to methods, such as graphical parameters (see par). Many methods will accept the following arguments:

type

what type of plot should be drawn. Possible types are

  • "p" for points,

  • "l" for lines,

  • "b" for both,

  • "c" for the lines part alone of "b",

  • "o" for both ‘overplotted’,

  • "h" for ‘histogram’ like (or ‘high-density’) vertical lines,

  • "s" for stair steps,

  • "S" for other steps, see ‘Details’ below,

  • "n" for no plotting.

All other types give a warning or an error; using, e.g., type = "punkte" being equivalent to type = "p" for S compatibility. Note that some methods, e.g.plot.factor, do not accept this.

main

an overall title for the plot: see title.

sub

a sub title for the plot: see title.

xlab

a title for the x axis: see title.

ylab

a title for the y axis: see title.

asp

the y/x aspect ratio, see plot.window.

grid

logical; if TRUE, a background grid will be drawn

col.grid

grid color

col.acc

grid accent color

Examples

gplot(1:10)
gplot(mtcars)
gplot(mpg ~ wt, data = mtcars)


raredd/plotr documentation built on Nov. 19, 2023, 4:09 a.m.