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 title is incorrectly aligned when horizontal #2465
Comments
@clauswilke have you seen this too? I quickly skimmed through your PRs but I didn't see anything that addressed this explicitly |
Note that
|
Oh so this probably isn't a regression |
The bigger issue, in my mind, is that there is no simple workaround, because the
I'll see if there's a simple way to fix this that doesn't require touching much code. In the long run, I think the legend drawing code needs to be rethought from the ground up, but that's not for 2.3.0. |
Workaround of sorts: library(ggplot2)
ggplot(mtcars, aes(hp, disp, color = mpg, shape = factor(cyl))) +
geom_point(size = 2) +
theme(legend.position = "top") +
guides(shape = guide_legend(label.position = "bottom",
title.position = "left", title.vjust = 0.8),
color = guide_legend(label.position = "top",
title.position = "right", title.vjust=0.4)) Created on 2018-05-07 by the reprex package (v0.2.0). |
I now see that there are (at least) two separate issues. One is that
|
The latter issue about the margins for legend text/titles has been raised in #1502. I tried to tackle that after reworking |
@karawoo I just opened a pull request (#2556) that provides a partial fix for this issue. I hadn't seen #1502 previously and will take a look. My fix for legend titles would likely work for legend text as well. (Meaning: we can use the same technique to fix legend text. But it isn't currently fixed in the pending pull request.) |
Dear @clauswilke and @hadley
|
Hi again, I did find a workaround solution. Only a bit of merging trickery was needed between
This produces: All the absolute best! |
The text was updated successfully, but these errors were encountered: