[R] acf() plot of matrix cuts y-axis labels

Duncan Murdoch murdoch.duncan at gmail.com
Fri Mar 2 18:53:18 CET 2012


On 02/03/2012 11:40 AM, Folkes, Michael wrote:
> Hello all,
> I found a funny problem with y-axis labels when plotting acf(matrix) -
> the labels are too close to one of the margins and cut in half.
> Here's the problem:
>
> test<-matrix(rnorm(200),ncol=4)
> acf(test)
>
> This doesn't fix the problem:
> test<-matrix(rnorm(200),ncol=4)
> par(mar=c(3,3,2,0.2),oma=c(0,0,0,0))
> acf(test)
>
> This does fix the margin. I understand why, but not sure why ONLY this
> will work?
> test<-matrix(rnorm(200),ncol=4)
> acf(test,mar=c(3,3,2,0.2),oma=c(0,0,0,0))

acf uses plot.acf to do the plotting.  If you read ?plot.acf, you'll see 
how it comes up with acf settings:  the global ones are overridden for 
data like yours.

You might want to do some experimenting and suggest better defaults for 
plot.acf.

Duncan Murdoch



More information about the R-help mailing list