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

Could a top legend and top colourbar align better? #411

Open
davidhodge931 opened this issue Nov 19, 2024 · 0 comments
Open

Could a top legend and top colourbar align better? #411

davidhodge931 opened this issue Nov 19, 2024 · 0 comments

Comments

@davidhodge931
Copy link

Hi, awesome package! I was wondering if a top legend and top colourbar could align a bit better?

library(tidyverse)
library(palmerpenguins)
library(patchwork)
#> Warning: package 'patchwork' was built under R version 4.4.1
  
p1 <- penguins |> 
  ggplot() +
  geom_histogram(aes(x = flipper_length_mm, 
                     fill = species)) +
  theme(legend.position = "top") +
  theme(legend.title.position = "top")


p2 <- penguins |> 
  ggplot() +
  geom_point(aes(x = flipper_length_mm, 
                 y = body_mass_g,
                 colour = bill_length_mm)) +
  theme(legend.position = "top") +
  theme(legend.title.position = "top")

p1 + p2
#> `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
#> Warning: Removed 2 rows containing non-finite outside the scale range
#> (`stat_bin()`).
#> Warning: Removed 2 rows containing missing values or values outside the scale range
#> (`geom_point()`).

Created on 2024-11-20 with reprex v2.1.1

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

No branches or pull requests

1 participant