[R] Another plot question

Andy Bunn abunn at montana.edu
Tue Nov 19 20:31:37 CET 2002

Here is another, perhaps trivial, plotting question.

I am making a filled contour plot and have almost everything dialed in
the way I want it. The last hurdle (that I can foresee) is adjusting the
look of the key. I'm plotting the 25%, 50%, 75%, and 95% quantiles and I
want the key to be evenly spaced, e.g., the width of the 25% and the 95%
should look the same on the key. They are labeled and ticked right. Is
there a way to space them correctly?

Thank you all for being an outstanding user community,


#example to post

junk.mat <- matrix(rnorm(12800), 128, 100)

xYears <- 0:(nrow(junk.mat)-1)
yPeriod <- 1:ncol(junk.mat)
temp <- seq(10, ncol(junk.mat), 10)
myLabels <- 2^(temp/10)
cwtquants <- quantile(junk.mat, probs = c(0, 0.25, 0.5, 0.75, 0.95, 1))
quant2plot <- c(cwtquants[1], cwtquants[2], cwtquants[3], cwtquants[4],
cwtquants[5], cwtquants[6])

               levels = quant2plot,
               plot.axes = {axis(1); 
                            axis(2, temp, labels = myLabels[10:1]) },
               plot.title = title(main = "Continuous Wavelet Transform",
               xlab = "Time(Years)", ylab = "Log(Period)"),
               key.title = title(main="Power"),
               key.axes = axis(4, quant2plot))

r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch

More information about the R-help mailing list