|
Dear all, I can't figure out a way to have more than one plot using filled.contour() in a single plate. I tried to use layout() or par(), but the way filled.contour() is written seems to override those commands. Any suggestions would be really appreciated. Jonathan [[alternative HTML version deleted]] ______________________________________________ [hidden email] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. |
|
Take a look at the code for filled.contour().
You'll find a line beginning .Internal(filledcontour( You can adapt this line and the lines around it to achieve what you want. Good luck Bob Kinley -----Original Message----- From: [hidden email] [mailto:[hidden email]] On Behalf Of Jonathan Hughes Sent: 04 July 2012 02:01 To: [hidden email] Subject: [R] help with filled.contour() - Dear all, I can't figure out a way to have more than one plot using filled.contour() in a single plate. I tried to use layout() or par(), but the way filled.contour() is written seems to override those commands. Any suggestions would be really appreciated. Jonathan [[alternative HTML version deleted]] ______________________________________________ [hidden email] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. ______________________________________________ [hidden email] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. |
|
In reply to this post by Jonathan Hughes
On Jul 3, 2012, at 9:01 PM, Jonathan Hughes wrote: > Dear all, > I can't figure out a way to have more than one plot using > filled.contour() in a single plate. I tried to use layout() or > par(), but the way filled.contour() is written seems to override > those commands. > Any suggestions would be really appreciated. > Jonathan > > [[alternative HTML version deleted]] This is the code in filled.contour that is overriding you par() efforts. mar.orig <- (par.orig <- par(c("mar", "las", "mfrow")))$mar on.exit(par(par.orig)) w <- (3 + mar.orig[2L]) * par("csi") * 2.54 layout(matrix(c(2, 1), ncol = 2L), widths = c(1, lcm(w))) par(las = las) mar <- mar.orig mar[4L] <- mar[2L] mar[2L] <- 1 par(mar = mar) plot.new() You could rewrite the function to allocate space differently. Note this portion of the layout help page: "These functions are totally incompatible with the other mechanisms for arranging plots on a device: par(mfrow),par(mfcol) and split.screen." -- David Winsemius, MD West Hartford, CT ______________________________________________ [hidden email] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. |
|
In reply to this post by Robert Kinley
Hello,
You can use .filled.contour (with initial dot) with par. I've tested it with one of the help page examples, reformulated to use the args of .filled.contour and it works. x <- y <- seq(-4*pi, 4*pi, len = 100) r <- sqrt(outer(x^2, y^2, "+")) z <- cos(r^2)*exp(-r/(2*pi)) zlim <- range(z, finite=TRUE) # levels <- pretty(zlim, 20) col <- heat.colors(20) # op <- par(mfrow=c(1, 2)) plot.new() .filled.contour(x, y, z, levels = levels, col=col) plot.new() .filled.contour(x, y, z, levels = levels, col=col) par(op) Hope this helps, Rui Barradas Em 04-07-2012 09:39, Robert Douglas Kinley escreveu: > Take a look at the code for filled.contour(). > > You'll find a line beginning .Internal(filledcontour( > > You can adapt this line and the lines around it to achieve what you want. > > Good luck > > Bob Kinley > > -----Original Message----- > From: [hidden email] [mailto:[hidden email]] On Behalf Of Jonathan Hughes > Sent: 04 July 2012 02:01 > To: [hidden email] > Subject: [R] help with filled.contour() - > > > > > > > > > > > > Dear all, > I can't figure out a way to have more than one plot using filled.contour() in a single plate. I tried to use layout() or par(), but the way filled.contour() is written seems to override those commands. > Any suggestions would be really appreciated. > Jonathan > > [[alternative HTML version deleted]] > > ______________________________________________ > [hidden email] mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > > ______________________________________________ > [hidden email] mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > ______________________________________________ [hidden email] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. |
| Powered by Nabble | Edit this page |
