Skip to content

Bug: rotated text in guide_colourbar() #5455

Closed
@teunbrand

Description

@teunbrand

In current main branch, when using rotated legend text with vjust = 1, the text starts overlapping the colourbar itself.
In the example below, I expected the left-most 'C' to start at the right of the colourbar.

devtools::load_all("~/packages/ggplot2/")
#> ℹ Loading ggplot2

ggplot(mpg, aes(displ, hwy)) +
  geom_point(aes(colour = cty)) +
  scale_colour_continuous(
    breaks = c(10, 20, 30),
    labels = c("A", "B\nB", "C\nC\nC")
  ) +
  theme(
    legend.text = element_text(angle = 270, vjust = 1)
  )

Created on 2023-10-05 with reprex v2.0.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugan unexpected problem or unintended behaviorguides 📏

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions