-
-
Notifications
You must be signed in to change notification settings - Fork 982
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
Legend spacing is changed comparing Rmd -> HTML render with regular R console output #408
Comments
One thing that might be causing this are the transformations related to the On Fri, Mar 27, 2015 at 7:38 AM, paullemmens notifications@github.com
|
I've checked your suggestion, but it does not make a difference. Note that I checked both |
Them I'm not sure what might be causing this. @yihui any ideas? |
@paullemmens Per suggestion of knitr FAQ 1 (http://bit.ly/knitr-faq), could you update your packages first? I do not see any difference between the two plots: The plot in the X11 window: The plot in the HTML output from R Markdown: I tried it with and without
|
@yihui I ran the update and then I indeed get the same output in the console (graph) and in HTML. So I started adding packages and options. While doing that, I realized that I have this typical knitr chunk that I just cut & paste across documents in which I set my default device to CairoSVG. When I switched on this option in my sample code, things went south again: So Cairo appears to be the culprit! Thanks for thinking along! |
This old thread has been automatically locked. If you think you have found something related to this, please open a new issue by following the issue guide (https://yihui.org/issue/), and link to this old issue if necessary. |
The change is minimal and difficult to spot, but in the figures below, look at the spacing between the last characters of each legend string and the box with, for instance, the colored dot. Note that using
knitrBootstrap
exacerbates the situation but the principled problem lies with rmarkdown.The example below is a bit difficult, but I have had real life examples where there's actually overlap of the legend names and legend boxes (see below).
Steps to reproduce (and
sessionInfo()
all the way at the bottom.When you compare figure 1 and 2, you'll see that the box of both plots has the same size. I've taken a screen shot with both plots partially overlapping and highlighted the problem points. Although there is a bit of a difference in scaling, the arrows show that the width of the full legend is different and the boxes highlight where the text and color box is much closer in the HTML file.
I can understand that there may be some overall scaling needed for the
rmarkdown
processing, but I don't think that should affect the spacing of the (full) legend box.The following screen grab is from a more realistic plot. It clearly shows that the
d
fromplanned
hits the box frombooked
.The text was updated successfully, but these errors were encountered: