Skip to content

legend titles need more padding #1881

@baptiste

Description

@baptiste

Not sure if it's a recent change (I'm using the dev version fresh from github), but with a large enough font the legend title collides with the legend and I can't find any setting to move it.

MRE

set.seed(123)
dummy <- data.frame(x=runif(10), y=runif(10), f = gl(2,5))
ggplot(dummy, aes(x,y, shape=f)) + 
  geom_point() +
  labs(shape="guide") +
  theme_grey(24)

With the default font size things are OK, albeit snug

screen shot 2016-10-29 at 4 58 42 pm

With a larger font size (graphic aimed for slides), however,

screen shot 2016-10-29 at 4 58 34 pm

I tried,

legend.margin = margin(100,100,100,100)
legend.spacing.y = unit(1,"cm")
legend.title = element_text(vjust = 2)

also played with guide_legend etc. to no avail.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions