简体   繁体   中英

How to separate graphs and then plot their on one graphical window?

I have three time series md1 , md2 , md3 , three ARIMA models f1 , f2 , f3 . I'd like to plot AR- и МA-roots of ARIMA models in one graphical window. I have tried:

library(forecast)

md1 <- runif(100, 0, 1)
md2 <- runif(100, 0, 1)
md3 <- runif(100, 0, 1)

f1<-arima(md1,order=c(1,1,0))
f2<-arima(md2,order=c(1,1,0))
f3<-arima(md3,order=c(2,1,2))

par(mfrow = c(1,3))
#  AR- и МA-roots of ARIMA models
plot(f1) # one graph
plot(f2) # one graph
plot(f3) # two graphs

As the result, I see the last plot only, ie plot(f3) . Of course, I can add the windows() command

plot(f2); windows()

and make a new graphical window for plot(f3) . Also, I have tried to change options of the par() function, likes

par(mfrow = c(2,2))

and tried to create a new object

 p3 <- plot(f3)

but expected result wasn't achieved.

Question . How to separate two graphs generated by the plot(f3) command?

Expected result:

预期结果:

I have found the answer on my question here . This is the code which was not included to the package forecast by the author.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM