0

I don't know the number of rows that will need to be plotted ahead of time. I read the documentation for the par function but could not find the info such as a special parameter to indicate we don't know what the value will be.

  • Welcome to SO! Could you make your problem reproducible by sharing a sample of your data and the code you're working on so others can help (please do not use `str()`, `head()` or screenshot)? You can use the [`reprex`](https://reprex.tidyverse.org/articles/articles/magic-reprex.html) and [`datapasta`](https://cran.r-project.org/web/packages/datapasta/vignettes/how-to-datapasta.html) packages to assist you with that. See also [Help me Help you](https://speakerdeck.com/jennybc/reprex-help-me-help-you?slide=5) & [How to make a great R reproducible example?](https://stackoverflow.com/q/5963269) – Tung Dec 04 '18 at 05:28
  • If you are talking about `par("mfrow")` or `par("mfcol")`, I believe there is no way to dynamically resize the overall canvas. Realize that, under the hood, these are apportion of fraction of the canvas for plots. So if you start with `par(mfrow=c(2,3))`, then it divides the x-axis into thirds and the y-axis into halves. If you wanted to later add another row, that would result in 150% of the plot space on the canvas. There are mechanisms in (for example) grid-based plotting (e.g., `ggplot2` and `lattice`) so that you can after-the-fact combine arbitrary number of plots. But not base plot. – r2evans Dec 05 '18 at 05:18

0 Answers0