points {base} | R Documentation |
points
is a generic function to draw a sequence of points at the
specified coordinates.
The specified character(s) are plotted, centered at the coordinates.
Graphical parameters are permitted as arguments to this function.
points(x, ...)
points.default(x, y=NULL, type="p", pch=1, col="black", bg=NA, cex=1, ...)
x , y |
coordinate vectors of points to plot. |
type |
character indicating the type of plotting; actually any of
the |
pch |
plotting ‘character’, i.e. symbol to use. In addition, there is a special set of R plotting symbols which
can be obtained with
|
col |
color code or name, see |
bg |
background (“fill”) color for open plot symbols |
cex |
character expansion |
... |
Further graphical parameters (see |
plot
, lines
, and the underlying “primitive”
plot.xy
.
plot(-4:4, -4:4, type = "n")# setting up coord. system
points(rnorm(200), rnorm(200), col = "red")
points(rnorm(100)/2, rnorm(100)/2, col = "blue", cex = 1.5)
##-------- Showing all the graphics symbols ------------
Pex <- if(.Device=="postscript") 9 else 20
ipch <- 1:25; dd <- c(-1,1)/2
rx <- dd+ range(ix <- (ipch-1) %/% 5)
ry <- dd+ range(iy <- 3 + 4-(ipch-1) %% 5)
plot(rx, ry, type="n", axes = F, xlab = "", ylab = "",
main = "plot symbols : points (.. pch = * )")
abline(v=ix, h=iy, col = "lightgray", lty = "dotted")
for(i in ipch) { # red symbols with a yellow interior (where available)
points(ix[i], iy[i], pch=i, col="red", bg="yellow", cex = Pex)
text (ix[i] - .3, iy[i], i, col="brown", cex = 1.5)
}