ggeasy
ggeasy copied to clipboard
Feature request: make functions relating to removing/changing axes able to work on top/bottom/both or left/right/both
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.
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