Open netique opened 2 years ago
HI @netique ,
I am sorry but I am not sure to have grasp what the issue is despite your GIF. Is this an issue with the inline plots below each chunk ? Or in the viewer with the resulting document ?
However, when I define a custom chunk option in the chunk header
What is the custom option in your example ? This is an example with fig.asp
only here, right ?
it renders too small and fills the source pane width (see the GIF below).
Do you mean that inline image width is recalculated while your reduce the source pane window width ?
Thanks for the additional precision you can provide.
Hi @cderv,
Is this an issue with the inline plots below each chunk ?
Exactly. The first renders fine, but the second behaves unexpectedly. Note that the content is the same, only the second chunk possess fig.asp
option (fig.width
and fig.height
also do the trick, even when you use the defaults).
The output document is OK, the second plot has aspect ratio as requested; font size and width stays the same for both, as expected. Not so in the Source pane, though.
Maybe it's about screen DPI, I have two monitors with 4K and FHD, 4K being the main one. RStudio and Qt version used in RStudio have been experiencing DPI/scale issues at multidisplay systems AFAIK.
If this is an issue with the way plots are resized in the inline output of the source pane for Rmd document, this would belong into the RStudio IDE repo. I really don't know if they respect the fig.asp
option and what is done to resize the image while the window is resized. What I know is that they deal with inline image size in the IDE and that it is / will be different than the one in resulting document produced by rmarkdown. I think it is by convenience for a good user experience when previewing the document content inline.
It would be best to share with IDE team there. Would you mind reopening one there following there issue guide ? https://github.com/rstudio/rstudio/wiki/Writing-Good-Bug-Reports
thanks !
Not sure if the issue pertains
rmarkdown
,knitr
or evenRStudio
more, but plot display inside.Rmd
documents seems wrong, or unexpected at least. The output (no matter what format) is 100% correct and fulfils my expectation and so does the inline display in an R Markdown document in RStudio (with default options). However, when I define a custom chunk option in the chunk header, suddenly, it renders too small and fills the source pane width (see the GIF below).knitr::opts_chunk$set(fig.asp = .5)
also leads to the same beahviour. It seems that when I create a custom output format with the exact options and use it inside the YAML header, plots do display normally..Rmd
content:Created on 2021-12-20 by the reprex package (v2.0.1)
Checklist
When filing a bug report, please check the boxes below to confirm that you have provided us with the information we need. Have you:
[x] formatted your issue so it is easier for us to read?
[x] included a minimal, self-contained, and reproducible example?
[x] pasted the output from
xfun::session_info('rmarkdown')
in your issue?[x] upgraded all your packages to their latest versions (including your versions of R, the RStudio IDE, and relevant R packages)?
[x] installed and tested your bug with the development version of the rmarkdown package using
remotes::install_github("rstudio/rmarkdown")
?