plot.default(x, y, type = "p", log = "")
x
is given,
time(x)
is plotted on the x-axis and
x
on the y-axis.
If a complex
x
is given,
Re(x)
is plotted on the x-axis and
Im(x)
on the y-axis.
Missing values (NA) are allowed.
Any points containing missing values will be omitted from the plot.
"p"
points
"l"
lines
"b"
both
"o"
both (overlaid)
"n"
nothing
"s"
stairsteps, first segment is horizontal
"S"
stairsteps, first segment is vertical
"h"
high-density lines drawn vertically from the x-axis to the
coordinates of the points.
"x"
,
"y"
, or
"xy"
specify which axes are to
be plotted on a logarithmic base 10 scale.
By default, logarithmic axes are not produced.
This is the default method for the
plot
function.
If there are non-positive observations in a coordinate that is plotted
on a logarithmic scale, then those observations are not plotted and a
warning is given.
To get an axis label at the extremes, use, for example,
ylim=range(pretty(y))
.
The
log
argument to
plot
sets the axes to a log base 10 scale (this
differs from the
log
function, which is the natural logarithm).
The stairsteps options are most commonly used when
x
is ordered. If
x
is ordered and
y
is non-decreasing (e.g. an empirical distribution
function),
type = "S"
stairsteps will dominate (be nowhere less than)
type = "s"
stairsteps.
plot(corn.rain, corn.yield) # simple scatter plot plot(x, y, type = "l") # connected lines plot(x, y, log = "xy") # log10-log10 plot plot(x, y, type = "n");text(x, y) # do not plot, then # use text to label each point from 1 to n plot(gnp, type = "h") # high-density plot of time-series plot(density(x), type = "l") # plot of list xy