plot {base} | R Documentation |
Generic X-Y Plotting
Description
Generic function for plotting of R objects. For more details about
the graphical parameter arguments, see par
.
Usage
plot(x, ...)
plot(x, y, xlim=range(x), ylim=range(y), type="p",
main, xlab, ylab, ...)
plot(y ~ x, ...)
Arguments
x |
the coordinates of points in the plot. Alternatively, a
single plotting structure or any R object with a
|
y |
the y coordinates of points in the plot, optional
if |
xlim , ylim |
the ranges to be encompassed by the x and y axes. |
type |
what type of plot should be drawn. Possible types are
|
main |
an overall title for the plot. |
xlab |
a title for the x axis. |
ylab |
a title for the y axis. |
... |
graphical parameters can be given as arguments to
|
Details
For simple scatter plots, plot.default
will be used.
However, there are plot
methods for many R objects,
including function
s, data.frame
s,
density
objects, etc. Use methods(plot)
and
the documentation for these.
See Also
plot.default
, plot.formula
and other
methods; points
, lines
, par
.
Examples
data(cars)
plot(cars)
lines(lowess(cars))
plot(sin, -pi, 2*pi)
## Discrete Distribution Plot:
plot(table(rpois(100,5)), type = "h", col = "red", lwd=10,
main="rpois(100,lambda=5)")