Bug? Low resolution for image rendering in R Notebooks in Mac App

Hi, I am new to R. Several weeks ago I download the latest R and RStudio and tried some code of ggplot in R Notebooks. Everything works fine and the image rendering in the notebooks are in high resolution and high quality.

However today I reopen RStudio and run the code again. Now the images rendering in the notebooks suddenly turn to be in low resolution and less sharp. I may change some basic options in RStudio but nothing else. I want the high resolution back and search the internet and find nothing except this question where a reply says that "as far as I know, R Notebooks preview is always in low resolution for fast rendering". I am now totally confused and need some helps.

Update: I just tried use chunk options e.g. {r dpi=300, fig.retina=1} and then find these chunk options do not work at all. The figure is always "700 x 433 pixels (Natural: 700 x 432 pixels)". Also chunk options like fig.cap does not work but only fig.height and fig.weight work.

Update2: I finally find the problem. This is really weird. I find that if I drag the left panel to the maximum (which means there is no right panel at all) and then close the rstudio, reopen rstudio and run the code, the image becomes low resolution with "Natural: 700 x 432 pixels". Then if I drag back the right panel, and run the code, the image now becomes high resolution with "Natural: 1400 x 865 pixels". I think this might be a bug of the rstudio app under Mac. Also the problem that chunk options like dpi or fig.cap does not work still remains. But this might be a different problem as I find some similar questions here and in stack overflow.


You should open a bug report in RStudio Github repository if you think it is an issue: Writing Good Bug Reports · rstudio/rstudio Wiki · GitHub

Can you open an issue in knitr or rmarkdown repository with a reproducible example ? Thank you!

This topic was automatically closed 21 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.