RStudio fails to display plots in particular with rescaled apps (display settings)

Following code produces a plot, however, we got several feedback that the plot wasn't shown in RStudio. One solution usually is to resize the plot window to make it larger, but this often didn't work for some users.

library(performance)
library(see)
data(mtcars)
mod <- lm(mpg ~ disp + cyl, data = mtcars)
plot(performance::check_model(mod), debug = TRUE)

We now could reproduce this issue, which seems to be related to a display setting, when the apps scaling is increased, see this link: View display settings in Windows - Microsoft Support

While I had no problems producing the plots with 100% scaling, I got an error when I set the scaling to 125% and the plot window was too small. Given that some users with high resolutions probably have set the scaling to a higher value than 100%, RStudio generally fails to show the plots, simply due to the scale-setting.

Is there any way to resolve this issue from RStudio side?

There are two videos demonstrating the effects:
works, scaling 100%

fails when plot window too small, scaling 125%

Maybe I should add that this problem might (not 100% sure) be related when multiple plots are put together using the patchwork package (like in the example above). User feedback suggests that "single" (ggplot2) plots work fine.

I got this reply, which actually "solves" this issue:

It is only partly because of patchwork. The issue comes because there is not enough area for the plot elements as you zoom in and this is exasperated by putting more plot elements in the plot with patchwork. Some elements in a ggplot2 plot have absolute sizes, e.g. all text elements and by extensions the areas that are defined to have enough space for these elements (titles, axes, etc). As you zoom, these absolute areas increase in size and at some point there is simple not enough room in the plot area to contain them all, which is when you get this error.

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.