Skip to content

Fixes #3718 - #3720

Merged
clauswilke merged 1 commit into
tidyverse:v3.3.0-rcfrom
wilkelab:issue-3718-axis-text
Jan 10, 2020
Merged

clauswilke merged 1 commit into
tidyverse:v3.3.0-rcfrom
wilkelab:issue-3718-axis-text

Conversation

@clauswilke

@clauswilke clauswilke commented Jan 10, 2020 •

Copy link
Copy Markdown
Member

This fixes #3718. I am confident about this fix. It doesn't touch merge_element() at all, only makes a minor change in draw_axis(), and simply copies over the relevant properties manually instead of merging the elements. Reprex below shows that things work as expected with this fix.

library(ggplot2)
library(ggtext)

ggplot(mpg, aes(class)) + 
  geom_bar() +
  scale_x_discrete(
    name = "vehicle *class*",
    labels = c("2seater", "*compact*", "midsize", "**minivan**", "pickup", "<sub>sub</sub>compact", "suv")
  ) +
  theme(
    axis.title.x = element_markdown(
      linetype = 1, fill = "cornsilk", r = unit(5, "pt"), padding = margin(4, 4, 4, 4)
    ),
    axis.text.x = element_markdown(
      linetype = 1, fill = "cornsilk", r = unit(5, "pt"), padding = margin(4, 4, 4, 4)
    )
  )

Created on 2020-01-09 by the reprex package (v0.3.0)

@thomasp85 thomasp85 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@clauswilke

Copy link
Copy Markdown
Member Author

@thomasp85 Thanks! Just to be clear: This PR is against the RC branch. Is it still Ok to merge? And if yes, should I make the same PR against master also or just wait until the fix makes it way from RC to master? (It's not urgent to get this into master, but I'd like to have the fix in the release if possible.)

@thomasp85

Copy link
Copy Markdown
Member

Yes, it’s fine to have in rc. You are modifying unreleased code so there are no breaking changes to worry about. Just wait for rc to be merged into master. No need to dual commit

@clauswilke
clauswilke merged commit 8acb760 into tidyverse:v3.3.0-rc Jan 10, 2020
@paleolimbot

Copy link
Copy Markdown
Member

Sorry I'm late on the uptake! This looks great!

@clauswilke
clauswilke deleted the issue-3718-axis-text branch January 10, 2020 22:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants