Closed paullemmens closed 9 years ago
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 fig.width
knitr option to see if it fixes the issue. Also you may be able to fix the problem by adjusting title.hjust=0
in guide_legend
.
There really shouldn't be any reason that knitrBootstrap
would exacerbate this problem, it doesn't do anything additional to the image output than what knitr would do.
Hi Jim,
This is the github version. I totally agree and don't quite understand why bootstrap would exacerbate, but it seems to do. Next week I'll try and concoct an even clearer example.
Regarding the hjust, you're right: it makes the problem less, but I have also seen it with the actual labels of the color scale. I'll try your other suggestions next week.
Thnx!
On Fri, Nov 14, 2014, 21:20 Jim Hester notifications@github.com wrote:
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 fig.width knitr option to see if it fixes the issue. Also you may be able to fix the problem by adjusting title.hjust=0 in guide_legend.
There really shouldn't be any reason that knitrBootstrap would exacerbate this problem, it doesn't do anything additional to the image output than what knitr would do.
— Reply to this email directly or view it on GitHub https://github.com/jimhester/knitrBootstrap/issues/74#issuecomment-63123321 .
Hi @jimhester ,
It's been quite a while but I tracked it down to actually being a Cairo (package) issue. See https://github.com/rstudio/rmarkdown/issues/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:
R version 3.1.1 (2014-07-10) Platform: x86_64-w64-mingw32/x64 (64-bit)
locale: [1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252 LC_MONETARY=English_United States.1252 LC_NUMERIC=C
[5] LC_TIME=English_United States.1252
attached base packages: [1] graphics grDevices utils datasets stats methods base
other attached packages: [1] Cairo_1.5-6 rmarkdown_0.3.10 ggplot2_1.0.0
loaded via a namespace (and not attached): [1] colorspace_1.2-4 digest_0.6.4 evaluate_0.5.5 formatR_1.0 grid_3.1.1 gtable_0.1.2 htmltools_0.2.6 knitr_1.7.1
[9] knitrBootstrap_1.0.0 labeling_0.3 markdown_0.7.4 MASS_7.3-33 mime_0.2 munsell_0.4.2 plyr_1.8.1 proto_0.3-10
[17] Rcpp_0.11.3 reshape2_1.4 scales_0.2.4 stringr_0.6.2 tools_3.1.1 yaml_2.1.13