我已经用预测包中的 10 抗糖尿病药物销售额绘制了极坐标图和季节性图。您可以在下面看到代码和绘图:
library(forecast)
library(ggplot2)
library(fpp2)
library(gridExtra)
PLOT_SEAS<-ggseasonplot(a10, polar=TRUE) +
ylab("$ million") +
ggtitle("Polar seasonal plot: antidiabetic drug sales")
PLOT_LAG<-gglagplot(a10,seasonal = TRUE,set.lags = 1:12)+
ggtitle(" Lagged scatterplots")
grid.arrange(PLOT_SEAS,PLOT_LAG, nrow=1)
这些代码行的输出如下图所示,看起来不太好。
那么有人可以帮助我如何使用 grid.arrange 函数解决这个问题并使这个图表具有相同的高度吗?