Keep panel height the same as number of plot panels changes

In both cases you have a single plot, but in the first case it has three panels and in the second case it has one panel. If you want to preserve the aspect ratio of the plot, you'll need to adjust the height of the plot to be proportion to the number panels that you're displaying (i.e. the number of unique values of the variable that you're faceting by). You can see the basic approach in Error in eval: object 'variable' not found (data table feeding plot in Shiny app).

1 Like