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

Feature request: make functions relating to removing/changing axes able to work on top/bottom/both or left/right/both #73

Open
davidhodge931 opened this issue Jan 14, 2024 · 2 comments

Comments

@davidhodge931
Copy link

No description provided.

@jonocarroll
Copy link
Owner

Could you add an example of what you'd start with and what the result would be? It might only require a slight change to the which argument.

@davidhodge931
Copy link
Author

library(tidyverse)
library(palmerpenguins)

p <- penguins |> 
  ggplot(aes(x = flipper_length_mm, y = body_mass_g)) +
  geom_point() +
  facet_wrap(~species, strip.position = "bottom") +
  theme_classic() +
  scale_x_continuous(sec.axis = dup_axis())

p
#> Warning: Removed 2 rows containing missing values or values outside the scale range
#> (`geom_point()`).

#I would like to be able to do this
# p +
#   ggeasy::easy_remove_axes(which = "x.bottom")

#and acheive this
p +
  theme(
    axis.ticks.x.bottom = element_blank(),
    axis.title.x.bottom = element_blank(),
    axis.text.x.bottom = element_blank(),
    axis.line.x.bottom = element_blank()
  )
#> Warning: Removed 2 rows containing missing values or values outside the scale range
#> (`geom_point()`).

Created on 2024-01-15 with reprex v2.1.0

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

2 participants