Dear List, This is an embarrassing question, but I can seem to make this work…How do I change the font size on the xlab and on the numbers shown in the x-axis on the time series plot below. The arguments cex.lab and cex.axis do not seem to be 'passing' to the plot function. plot(ts(rnorm(100), start=2004, freq=12), ylab="RQI", xlab="My X lab", col="black", cex.lab=0.1, cex.axis=0.7) Thanks, Axel. [[alternative HTML version deleted]]
Hi: Try this: plot(ts(rnorm(100), start = 2004, freq = 12), xaxt = 'n', yaxt = 'n', xlab = '', ylab = '') axis(1, at = c(2004:2012), cex.axis = 0.7) axis(2, cex.axis = 0.7) title(xlab = 'My X lab', ylab = 'RQI', cex.lab = 0.1) The illegible dots in the region where the axis labels would normally be is the consequence of cex.lab = 0.1 :) This appears to be a consequence of plotting a time series with plot.ts(). In a basic scatterplot, such as plot(1:10, 1:10, cex.axis = 0.7, cex.lab = 0.5) the cex arguments for both axis and lab are respected. HTH, Dennis On Thu, Mar 17, 2011 at 4:37 PM, Axel Urbiz <axel.urbiz@gmail.com> wrote:> Dear List, > > This is an embarrassing question, but I can seem to make this work…How do I > change the font size on the xlab and on the numbers shown in the x-axis on > the time series plot below. The arguments cex.lab and cex.axis do not seem > to be 'passing' to the plot function. > > plot(ts(rnorm(100), start=2004, freq=12), > ylab="RQI", xlab="My X lab", col="black", cex.lab=0.1, cex.axis=0.7) > Thanks, > Axel. > > [[alternative HTML version deleted]] > > > ______________________________________________ > R-help@r-project.org 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. > >[[alternative HTML version deleted]]
On 2011-03-17 16:37, Axel Urbiz wrote:> Dear List, > > This is an embarrassing question, but I can seem to make this work?How do I > change the font size on the xlab and on the numbers shown in the x-axis on > the time series plot below. The arguments cex.lab and cex.axis do not seem > to be 'passing' to the plot function. > > plot(ts(rnorm(100), start=2004, freq=12), > ylab="RQI", xlab="My X lab", col="black", cex.lab=0.1, cex.axis=0.7)This seems to be a result of the way plot.ts is coded. It does seem unnecessarily restrictive to me, but there may be a good reason and it's easy to work around. If you want both axes/labels to be scaled the same way, just do: op <- par(cex.axis = 0.7, cex.lab = 0.1) plot(tsobject) par(op) For more control over the axes, skip labelling with the plot call and add the axes/labels with axis() and title(): plot(tsobject, ann=FALSE, axes=FALSE, frame=TRUE) axis(2, cex.axis=0.5) axis(1, cex.axis=1.2) title(xlab="this is X", cex.lab=0.8) See ?axis ?title Peter Ehlers> Thanks, > Axel. > > [[alternative HTML version deleted]] >