Re: [R] overlapping plots

From: <partha_bagchi_at_hgsi.com>
Date: Tue 02 Nov 2004 - 08:52:31 EST


Use a judicious combination of par(mai) and par(new = TRUE). For example:

par(mai = c(3,1,1,1))
x <- runif(50)
plot(x, xlim = c(1, 500), ylim = c( -5, 1), bty = "l")

par(mai = c(2,1.5,2,1))
par(new = TRUE)
x <- runif(50)
plot(x, xlim = c(1, 500), ylim = c( -5, 1), bty = "l")

par(mai = c(1,2,3,1))
par(new = TRUE)
x <- runif(50)
plot(x, xlim = c(1, 500), ylim = c( -5, 1), bty = "l")

Does that help?

Partha

"Carlisle Thacker" <Carlisle.Thacker@noaa.gov> Sent by: r-help-bounces@stat.math.ethz.ch 11/01/2004 04:09 PM  

        To:     r-help@stat.math.ethz.ch
        cc: 
        Subject:        [R] overlapping plots


How to combine three plots so that they partially overlap? As the data on all three are near the left side and top, it would be nice to draw the first, shift axes down and to the right and draw the second, and shift again to draw the third.

I could shift the data for the 2nd and 3rd plots and construct their axes by hand, but it would be great if R has an easier way.



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Tue Nov 02 09:48:24 2004

This archive was generated by hypermail 2.1.8 : Wed 03 Nov 2004 - 22:58:35 EST