-
Notifications
You must be signed in to change notification settings - Fork 61
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
knitrBootstrap inappropriately changes ggplot's legend label spacing #74
Comments
Is this knitrBootstrap from CRAN or github? I am guessing this is due to knitr resizing the overall image size, while the font size remains at the same pointsize, try playing with There really shouldn't be any reason that |
Hi Jim, This is the github version. I totally agree and don't quite understand why Regarding the hjust, you're right: it makes the problem less, but I have Thnx! On Fri, Nov 14, 2014, 21:20 Jim Hester notifications@github.com wrote:
|
Hi @jimhester , It's been quite a while but I tracked it down to actually being a Cairo (package) issue. See rstudio/rmarkdown#408 for reference. Thanks! |
Glad you figured it out! Thank you for coming back and closing this as well! |
For already quite a while I've noticed that in my (both) knitr and rmarkdown documents rendered with/using knitrBootstrap the labels of the legends of ggplot plots tend to overlap. The overlap is minimal, but visually present and is absent when making the same plot in the console. I must admit that the space seems to be shrunk when also (only) compiling using rmarkdown (or knitr), but the shrinking is much smaller.
The minimal Rmd is the following:
If you run this code chunk in the console, then following image is the result.
If you render the file using knitrBootstrap and rmarkdown (see below for versions), then the image becomes. Notice how the legend title overlaps with the first legend color box.
It is related to changing the font size of the legend title as well as the legend labels. Especially when I enlarge the label font size, the labels also start overlapping with the next color box. However, it remains the case that, even with larger label sizes, the overlapping never happens when plotting in the console. It's only a small detail, but it bugs me visually as well as out of curiosity I want to if and how to fix it.
When I said, at the top, 'for already quite a while', I meant that this happened for runs with knitr only (I think, if possible, even) in R 2.x, R 3.x, and especially with knitrBootstrap both in the CRAN and Github version.
The text was updated successfully, but these errors were encountered: