| Line 1... |
Line 1... |
| 1 |
\name{plot.default}
|
1 |
\name{plot.default}
|
| 2 |
\title{The Default Scatterplot Function}
|
2 |
\title{The Default Scatterplot Function}
|
| 3 |
\usage{
|
3 |
\usage{
|
| 4 |
plot.default(x, y, type="p", col=par("fg"), pch=par("pch"),
|
4 |
plot.default(x, y, type = "p", col = par("fg"), bg = NA,
|
| 5 |
xlim=NULL, ylim=NULL, log="", axes=TRUE,
|
5 |
pch = par("pch"), xlim = NULL, ylim = NULL, log = "",
|
| 6 |
frame.plot=TRUE, before=NULL, after=NULL,
|
6 |
axes = TRUE, frame.plot = TRUE, panel.first = NULL,
|
| - |
|
7 |
panel.last = NULL, ann = par("ann"), main = NULL,
|
| 7 |
ann=par("ann"), main=NULL, xlab=NULL, ylab=NULL, \dots)
|
8 |
xlab = NULL, ylab = NULL, cex = par("cex"),
|
| - |
|
9 |
lty = par("lty"), lwd = par("lwd"), \dots)
|
| 8 |
}
|
10 |
}
|
| 9 |
\alias{plot.default}
|
11 |
\alias{plot.default}
|
| 10 |
\arguments{
|
12 |
\arguments{
|
| 11 |
\item{x,y}{the \code{x} and \code{y} arguments provide the
|
13 |
\item{x,y}{the \code{x} and \code{y} arguments provide the x and y
|
| 12 |
x and y coordinates for the plot. Any reasonble way of defining
|
14 |
coordinates for the plot. Any reasonble way of defining the
|
| 13 |
the coordinates is acceptable.
|
15 |
coordinates is acceptable. See the function \code{\link{xy.coords}}
|
| 14 |
See the function \code{xy.coords} for details.}
|
16 |
for details.}
|
| 15 |
\item{type}{the type of plot desired. The following possibilities
|
17 |
\item{type}{the type of plot desired. The following possibilities are
|
| 16 |
are possible; \code{"p"} for points, \code{"l"} for lines,
|
18 |
possible; \code{"p"} for points, \code{"l"} for lines, \code{"o"}
|
| 17 |
\code{"o"} for overplotted points and lines,
|
19 |
for overplotted points and lines, \code{"b"} or \code{c} for points
|
| 18 |
\code{"b"} or \code{c} for points joined by lines,
|
- |
|
| 19 |
\code{s} and \code{S} for step functions and
|
20 |
joined by lines, \code{"s"} and \code{"S"} for step functions and
|
| 20 |
\code{"h"} for \emph{high density} vertical lines.}
|
21 |
\code{"h"} for \emph{high density} vertical lines.}
|
| 21 |
\item{col}{The colors for lines and points.
|
22 |
\item{col}{The colors for lines and points. Multiple colors can be
|
| 22 |
Multiple colors can be specified so that each point can
|
23 |
specified so that each point can be given its own color. If there
|
| 23 |
be given its own color. If there are fewer colors
|
24 |
are fewer colors than points they are recycled in the standard
|
| 24 |
than points they are recycled in the standard fashion.}
|
25 |
fashion.}
|
| - |
|
26 |
\item{bg}{???}
|
| 25 |
\item{pch}{a vector of plotting characters or symbols.}
|
27 |
\item{pch}{a vector of plotting characters or symbols.}
|
| 26 |
\item{xlim}{the x limits of the plot.}
|
28 |
\item{xlim}{the x limits of the plot.}
|
| 27 |
\item{ylim}{the y limits of the plot.}
|
29 |
\item{ylim}{the y limits of the plot.}
|
| 28 |
\item{log}{a character string which contains \code{"x"}
|
30 |
\item{log}{a character string which contains \code{"x"} if the x axis
|
| 29 |
if the x axis is to be logarithmic, \code{"y"} if the
|
31 |
is to be logarithmic, \code{"y"} if the y axis is to be logarithmic
|
| 30 |
y axis is to be logarithmic and \code{"xy"} or \code{"yx"}
|
- |
|
| 31 |
if both axes are to be logarithmic.}
|
32 |
and \code{"xy"} or \code{"yx"} if both axes are to be logarithmic.}
|
| 32 |
\item{axes}{a logical value indicating whether axes should
|
33 |
\item{axes}{a logical value indicating whether axes should be drawn on
|
| 33 |
be drawn on the plot.}
|
34 |
the plot.}
|
| 34 |
\item{frame.plot}{a logical indicating whether a box
|
35 |
\item{frame.plot}{a logical indicating whether a box should be drawn
|
| 35 |
should be drawn around the plot.}
|
36 |
around the plot.}
|
| 36 |
\item{before}{an expression to be evaluated after the
|
37 |
\item{panel.first}{an expression to be evaluated after the plot axes
|
| 37 |
plot axes are set up but before any plotting takes place.
|
38 |
are set up but before any plotting takes place. This can be useful
|
| 38 |
This can be useful for drawing background grids or
|
39 |
for drawing background grids or scatterplot smooths.}
|
| 39 |
scatterplot smooths.}
|
- |
|
| 40 |
\item{after}{an expression to be evaluated after plotting has taken place.}
|
40 |
\item{panel.last}{an expression to be evaluated after plotting has
|
| - |
|
41 |
taken place.}
|
| 41 |
\item{ann}{an logical value indicating whether the default annotation
|
42 |
\item{ann}{an logical value indicating whether the default annotation
|
| 42 |
(title and x and y axis labels) should appear on the plot (default \code{TRUE}).}
|
43 |
(title and x and y axis labels) should appear on the plot/}
|
| 43 |
\item{main}{a main title for the plot.}
|
44 |
\item{main}{a main title for the plot.}
|
| 44 |
\item{xlab}{a label for the x axis.}
|
45 |
\item{xlab}{a label for the x axis.}
|
| 45 |
\item{ylab}{a label for the y axis.}
|
46 |
\item{ylab}{a label for the y axis.}
|
| - |
|
47 |
\item{cex}{a numerical value giving the amount by which plotting text
|
| - |
|
48 |
and symbols should be scaled relative to the default}
|
| - |
|
49 |
\item{lty}{the line type}
|
| - |
|
50 |
\item{lwd}{the line width (is this used at all ???)}
|
| 46 |
\item{\dots}{graphical parameters may also be passed as arguments.}
|
51 |
\item{\dots}{graphical parameters may also be passed as arguments.}
|
| 47 |
}
|
52 |
}
|
| 48 |
\value{
|
53 |
\value{
|
| 49 |
This function is invoked for its side effect of drawing
|
54 |
This function is invoked for its side effect of drawing a scatter plot
|
| 50 |
a scatter plot in the active graphics window.
|
55 |
in the active graphics window.
|
| 51 |
}
|
56 |
}
|
| 52 |
\references{
|
57 |
\references{
|
| - |
|
58 |
Cleveland, W. S. (1985).
|
| 53 |
Cleveland, W. S. (1985). The Elements of Graphing
|
59 |
\emph{The Elements of Graphing Data}.
|
| 54 |
Data, Monterey, CA: Wadsworth.
|
60 |
Monterey, CA: Wadsworth.
|
| 55 |
}
|
61 |
}
|
| 56 |
\seealso{
|
62 |
\seealso{
|
| 57 |
\code{\link{plot}}, \code{\link{xy.coords}}.
|
63 |
\code{\link{plot}}, \code{\link{xy.coords}}.
|
| 58 |
}
|
64 |
}
|
| 59 |
\examples{
|
65 |
\examples{
|
| 60 |
data(cars)
|
66 |
data(cars)
|
| 61 |
Speed <- cars$speed
|
67 |
Speed <- cars$speed
|
| 62 |
Distance <- cars$dist
|
68 |
Distance <- cars$dist
|
| 63 |
plot(Speed, Distance, before=grid(8,8),
|
69 |
plot(Speed, Distance, panel.first = grid(8,8),
|
| 64 |
pch=0, cex=1.2, col="blue")
|
70 |
pch = 0, cex = 1.2, col = "blue")
|
| 65 |
plot(Speed, Distance,
|
71 |
plot(Speed, Distance,
|
| 66 |
before=lines(lowess(Speed, Distance), lty="dashed"),
|
72 |
panel.first = lines(lowess(Speed, Distance), lty = "dashed"),
|
| 67 |
pch=0, cex=1.2, col="blue")
|
73 |
pch = 0, cex = 1.2, col = "blue")
|
| 68 |
}
|
74 |
}
|