0

I'm using grid.arrange to display the following three plots on top of each other.

p1 <- ggseasonplot(ng2) + labs(title = "Natural Gas Consumption from Jan. 2001 to Nov. 2021 - Seasonal Plot", x = "Month", y = "Cubic Feet (Millions)") + scale_y_continuous(labels = unit_format(unit = "M", scale = 1e-6))
p2 <- ggsubseriesplot(ng2) + labs(title = "Natural Gas Consumption from Jan. 2001 to Nov. 2021 - Subseries Plot", x = "Month", y = "Cubic Feet (Millions)") + scale_y_continuous(labels = unit_format(unit = "M", scale = 1e-6))
p3 <- ggAcf(ng2, lag.max = 36) + labs(title = "Natural Gas Consumption from Jan. 2001 to Nov. 2021 - ACF Plot", x = "Lag", y = "Correlation") 

gridExtra::grid.arrange(p1, p2, p3, nrow = 3, ncol = 1)

The resulting plots are unreadable.

Here is the resulting output.

Using the heights function only seems to adjust plot size relative to one another. Any idea how to make each plot larger (longer) as a whole so each is more readable?

1 Answers1

0

In your markdown/knitr chunk, try a value like fig.height = 10

```{r, fig.height = 10}
# Small fig.width
ggplot(cars, aes(speed, dist)) + geom_point()
```

Or you can set the default height for all the figures in an Rmd file

knitr::opts_chunk$set(fig.height = 10)

References

wibeasley
  • 5,000
  • 3
  • 34
  • 62