[R] How to fit all points into plot?

Martin Lam tmlammail at yahoo.com
Thu Dec 29 23:19:04 CET 2005


I have a problem when I want to add new points (or a
new line) to the graph. Some points (or parts of the
line) are not shown on the graph because they lie
beyond the scale of the axis. Is there a way to
overcome this so all points (or the entire line) are
shown on the graph? Here's an example of my problem:

colors = c("red", "blue")

plot(x=rnorm(100,0,1), y=runif(100), type="p", pch=21,
col = colors[1])

# if I add these points not all of them are shown on
the graph
lines(x=rnorm(100,3,1), y=runif(100), type="p",
pch=24, col = colors[2])

Thanks in advance,


More information about the R-help mailing list