Knitting Rmd to HTML with vertical scrolling

I have a dashboard coded in an R Markdown file that knits to HTML. The original version has two columns, one containing three R chunks (each producing a single table) and the other containing two R chunks (each producing a single plot). The knitted version fits in the browser display window with no vertical scrolling. So far so good.

The problem is that I need to add a third plot. If I add the plot chunk to the second column (stacking three plots in that column), knitr automatically rescales to fit the browser window, reducing height (which is probably OK) but also proportionately reducing plot width, which makes two of the plots difficult to read. Putting the third plot in a third column works, but I've been asked to put it in the same column with the other plots.

I think I've tried very combination of fig.width, fig.height, out.width and out.height with no joy. Is there a way to get knitr to exceed the vertical dimensions of the browser display and add a vertical scrollbar to the page, so that plot heights (and thus widths) are kept reasonably large?

This turned out to be easy in my specific case, which is a flexdashboard file. I just had to change the opening YAML to

output: 
  flexdashboard::flex_dashboard:
    orientation: columns
    vertical_layout: scroll

(specifically, changing the vertical layout from the default fill to scroll).

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.