Skip to content

Change legend tick length inheritance #5652

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

Merged
merged 3 commits into from
Jan 19, 2024

Conversation

teunbrand
Copy link
Collaborator

This PR to the RC aims to fix a mild annoyance.

Briefly, instead of guides declaring their own legend.ticks.length with a default of unit(0.2, "npc"), we now inherit from the legend.key.size with a default of rel(0.2). For all guides in ggplot2 this is effectively the same. This has two benefits:

  • Guides don't need to bookkeep these defaults.
  • While npc units means something in the context of colour bars and bins guides, a guide extension might have a different viewport in which to display ticks and 'npc' units may be awkward and inconsistent. This PR avoids this.

@teunbrand teunbrand changed the base branch from main to rc/3.5.0 January 19, 2024 08:31
@teunbrand teunbrand changed the title Legend tick length Change legend tick length inheritance Jan 19, 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 6afb5d7 into tidyverse:rc/3.5.0 Jan 19, 2024
@teunbrand teunbrand deleted the legend_tick_length branch January 19, 2024 15:44
thomasp85 pushed a commit that referenced this pull request Feb 23, 2024
* `legend.ticks.length` inherits from `legend.key.size`

* set `legend.ticks.length` defaults in theme

* remove `legend.ticks.length` defaults from guides
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.

2 participants