Scatter Plots

DESCRIPTION:
Creates a scatter plot on the current graphics device.

USAGE:
plot.default(x, y, type = "p", log = "")

REQUIRED ARGUMENTS:
x,y:
coordinates of points. The coordinates can be given by two arguments that are vectors or by a single argument x which is a univariate time series, a complex vector, a matrix with 2 columns, or a list containing components named x and y. If a single numeric 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.

OPTIONAL ARGUMENTS:
type=:
one of the following options: "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.

log=:
values of "x", "y", or "xy" specify which axes are to be plotted on a logarithmic base 10 scale. By default, logarithmic axes are not produced.

Graphical parameters may also be supplied as arguments to this function (see par). In addition, the high-level graphics arguments described under par and the arguments to title may be supplied to this function.


SIDE EFFECTS:
a plot is created on the current graphics device.

DETAILS:
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.


SEE ALSO:
abline , arrows , axes , axis , box , frame , legend , lines , matplot , mtext , par , plot , points, segments , symbols , text , title , tsplot , usa .

EXAMPLES:
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