Skip to content

Conversation

@teunbrand
Copy link
Collaborator

This PR aims to fix #6069.

Briefly, this PR sets ticks lengths to 0 if the corresponding tick is blank.

Examples from #4722. Current situation:

library(ggplot2)

ggplot(mpg, aes(displ, cty)) +
  geom_point() +
  theme(
    axis.ticks = element_blank(),
    axis.ticks.length = unit(2, "cm")
  )

With this PR:

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

ggplot(mpg, aes(displ, cty)) +
  geom_point() +
  theme(
    axis.ticks = element_blank(),
    axis.ticks.length = unit(2, "cm")
  )

Created on 2024-09-03 with reprex v2.1.1

@teunbrand teunbrand added the visual change 👩‍🎨 Rendering change that will affect look of output label Sep 3, 2024
Copy link
Member

@thomasp85 thomasp85 left a comment

Choose a reason for hiding this comment

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

LGTM

@teunbrand teunbrand merged commit 3be5d6c into tidyverse:main Dec 2, 2024
13 checks passed
@teunbrand teunbrand deleted the no_ticks_no_space branch December 2, 2024 11:17
@Yunuuuu
Copy link

Yunuuuu commented Dec 4, 2024

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

visual change 👩‍🎨 Rendering change that will affect look of output

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Automatically remove the tick length when tick is blank

3 participants