-
-
Notifications
You must be signed in to change notification settings - Fork 878
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sizing of *saved* figures #2266
Comments
Thanks for the report. First let's not there is
So it is already quite complex to follow. There is also a specific configuration where if Lines 608 to 609 in 0b6bee2
Regarding plot saving, the chunk device is opened consideing the Lines 372 to 377 in 0b6bee2
Can you try setting Hope this helps understand a bit more the internals |
Thank you so much for the detailed response. We will try the retina option (I was aware of the other options and am pretty sure that they don't explain what we see, but we had not explicitly specified retina). I'll update this post once I'll have more to report. |
This is more of a feature request / curious question (after a lot googling and reading). I've noticed that fig.width, fig.height, etc. do not seem to determine the size of figures in the files that are saved as part of knitting (in fig.path), even when taking into account dpi.
For example, for a figure for which fig.width = 10 and fig.height = 10.5 (and default 72 dpi), I'm getting a 2580 × 1440 PNG figure (at 72 dpi) from knitting. But that is a width of 35.83 in instead of 10. My colleagues and I (all working on different MacOS versions, with fully up-to-date R, RStudio, and knitr versions) all experience this issue. Indeed, I can't remember this ever not having been the case. Is there a reason, why fig.width and fig.height would not directly spell out into the dimension of the figure, like in a ggsave command?
(For context, for final journal submissions/proofs, we usually need to submit all figures separately from the knitted document. This tends to result in a hotchpotch of figure sizes in the journal proofs, undoing all of our careful work to keep panel sizes, text sizes, etc. identical across figures. We'd love to be able to tell publisher to simply print all figures at 100% of their size but that's only possible if those sizes make sense.)
Sorry, if this is a stupid question that has been answered before. But we have been unable to find any solution to this issue (short of generating all figures both through knitr and ggsave), and since it's an issue that is affecting all of our projects, I'd thought I ask for your wisdom =). Thank you for your time, and any pointer you might be able to provide!
The text was updated successfully, but these errors were encountered: