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

Folkes, Michael Michael.Folkes at dfo-mpo.gc.ca
Fri Mar 2 19:10:12 CET 2012


Thanks for the advice.  I guess I should have read the acf help page
more thoroughly to appreciate the role of plot.acf().  Typical.
Thanks Duncan. 

-----Original Message-----
From: Duncan Murdoch [mailto:murdoch.duncan at gmail.com] 
Sent: March 2, 2012 9:53 AM
To: Folkes, Michael
Cc: r-help at r-project.org
Subject: Re: [R] acf() plot of matrix cuts y-axis labels

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