-1

I am trying to plot Autcorrelation Function from a time series. I'm using ggplotfunction ggAcf and I've got the next graph

enter image description here

This is my code

    acf_or<-ggAcf(data_or$y, lag.max=100)+
    theme(axis.text = element_text(size=base*expand), axis.title = element_text(size=base*expand))+
    ggtitle("")+labs(x="", y="")+ylim(c(-1,1))

I would like to make some changes to confidence interval lines, like color, width and linetype. Is there any option to do it changing some parameters in the function ggAcf?

  • Can you provide a [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) of the dataset you are plotting with `ggAcf` ? – dc37 Nov 17 '19 at 03:08
  • You can generate a time series using, for example, `rnorm(10000)`. – Jorge Mendoza Ruiz Nov 17 '19 at 03:12

1 Answers1

1

The code for ggAcf is here on Github as part of the forecast package. It's pretty readable, and you'll see that extra parameters to ggAcf are eventually passed into geom_segment -- so you might alter some of those aesthetics of the line segments, but not the confidence intervals.

For customizing the plot and confidence intervals specifically, you might try using the ggAcf code as a model, or other SO entries like this or this to build up your own plot.

ravic_
  • 1,731
  • 9
  • 13