Skip to content
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

legends for colour & fill not merging with guide_custom #7

Closed
davidhodge931 opened this issue Apr 26, 2024 · 2 comments
Closed

legends for colour & fill not merging with guide_custom #7

davidhodge931 opened this issue Apr 26, 2024 · 2 comments
Labels
🐛 bug Something isn't working

Comments

@davidhodge931
Copy link

Awesome new package - great work!

Minor thing I noticed was the legends for colour & fill were not merging with guide_custom

library(gguidance)
library(tidyverse)
library(palmerpenguins)

penguins |>
  group_by(species) |>
  summarise(across(flipper_length_mm, \(x) mean(x, na.rm = TRUE))) |>
  ggplot() +
  geom_col(
    aes(x = flipper_length_mm,
    y = species,
    colour = flipper_length_mm,
    fill = flipper_length_mm)) +
  guides(
    colour = guide_colourbar_custom(),
    fill = guide_colourbar_custom(),
  ) 

image

@teunbrand
Copy link
Owner

Thanks for the report David! As these are three little guides wearing a trenchcoat I'd still have to figure out how best choose merging criteria.

teunbrand added a commit that referenced this issue Apr 27, 2024
@teunbrand
Copy link
Owner

Should have better detection of what and cannot be merged now

library(gguidance)
#> Loading required package: ggplot2
library(tidyverse)
library(palmerpenguins)

penguins |>
  group_by(species) |>
  summarise(across(flipper_length_mm, \(x) mean(x, na.rm = TRUE))) |>
  ggplot() +
  geom_col(
    aes(x = flipper_length_mm,
        y = species,
        colour = flipper_length_mm,
        fill = flipper_length_mm)) +
  guides(
    colour = guide_colourbar_custom(),
    fill = guide_colourbar_custom(),
  ) 

Created on 2024-04-27 with reprex v2.1.0

@teunbrand teunbrand added the 🐛 bug Something isn't working label Apr 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants