Nicolai Schneider
2012-Sep-05 15:06 UTC
[R] cex.lab ignored in plot.zoo for multiple plots
Hello everyone, a problem with the plot.zoo function. In the parameters of the function, cex.lab is ignored. I tried to reduce the size of the yaxis labels by at least 50%. ------------------ Example: sample <- as.zoo(EuStockMarkets) par(las=1) plot.zoo(sample, plot.type="multiple", main="Time Series", xlab="Date", yaxt="n", cex.lab=0.5, xaxs="i") # Try playing with different values for cex.lab par(las=0) --------------- Any hints or suggestions? THX Nico [[alternative HTML version deleted]]
On Sep 5, 2012, at 8:06 AM, Nicolai Schneider wrote:> Hello everyone, > > a problem with the plot.zoo function. In the parameters of the function, > cex.lab is ignored. I tried to reduce the size of the yaxis labels by at > least 50%. > > ------------------ > > Example: > > sample <- as.zoo(EuStockMarkets) > > par(las=1) > > plot.zoo(sample, plot.type="multiple", main="Time Series", xlab="Date", > yaxt="n", cex.lab=0.5, xaxs="i") > # Try playing with different values for cex.labI would have thought that the parameter to use would be 'cex.axis'. Testing seems to confirm theory in this case.> > par(las=0) > > ----------------- David Winsemius, MD Alameda, CA, USA
Gabor Grothendieck
2012-Sep-11 14:48 UTC
[R] cex.lab ignored in plot.zoo for multiple plots
On Wed, Sep 5, 2012 at 11:06 AM, Nicolai Schneider <rstatistics.user at gmail.com> wrote:> Hello everyone, > > a problem with the plot.zoo function. In the parameters of the function, > cex.lab is ignored. I tried to reduce the size of the yaxis labels by at > least 50%. > > ------------------ > > Example: > > sample <- as.zoo(EuStockMarkets) > > par(las=1) > > plot.zoo(sample, plot.type="multiple", main="Time Series", xlab="Date", > yaxt="n", cex.lab=0.5, xaxs="i") > # Try playing with different values for cex.lab > > par(las=0) >Internally it uses mtext to write that text and mtext uses cex which is already taken. Here is a workaround: library(proto) p <- proto(plot.zoo = plot.zoo, mtext = function(...) graphics::mtext(..., cex = .5)) with(p, plot.zoo)(sample) -- Statistics & Software Consulting GKX Group, GKX Associates Inc. tel: 1-877-GKX-GROUP email: ggrothendieck at gmail.com