Skip to content

Strange plotting error

2 messages · Diviya Smith, Duncan Murdoch

#
On 12-02-14 3:13 PM, Diviya Smith wrote:
I think you misunderstand what "xlim" controls.  It sets the limit of 
the plot region that's guaranteed to be included, but the region is 
normally expanded.  It doesn't control what is plotted unless it falls 
outside the expanded region.

There are probably two ways to do what you want.  You can force the 
region not to expand, using xaxs="i" in the call.  This won't adjust the 
y axis to a smaller range; you'll need to do that yourself.

The other way is to manipulate the acf object to drop the lag 0 values; 
it is a pretty smart object, so you can do that using

x <- acf(data, lag=100, plot=FALSE)[1:100]  #only lags 1:100
plot(x)

Duncan Murdoch