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: more quick functions for removing axis content #76

Open
davidhodge931 opened this issue Feb 15, 2024 · 2 comments
Open

Comments

@davidhodge931
Copy link

I think it'd be super useful to have more quick functions to remove axes content. With the autocomplete, this makes it quicker and easier to add what you want.

It'd also to cool to have a variant for removing the lines and ticks, as this is a common thing to remove both.

Sorry to bombard you with feature ideas!

ggeasy::easy_remove_x_title()
ggeasy::easy_remove_y_title()
ggeasy::easy_remove_axes_title()

ggeasy::easy_remove_x_text()
ggeasy::easy_remove_y_text()
ggeasy::easy_remove_axes_text()

ggeasy::easy_remove_x_axis_line()
ggeasy::easy_remove_y_title()
ggeasy::easy_remove_axes_title()

ggeasy::easy_remove_x_axis_line()
ggeasy::easy_remove_y_line()
ggeasy::easy_remove_axes_line()

ggeasy::easy_remove_x_axis_ticks()
ggeasy::easy_remove_y_ticks()
ggeasy::easy_remove_axes_ticks()

ggeasy::easy_remove_x_axis_line_ticks()
ggeasy::easy_remove_y_line_ticks()
ggeasy::easy_remove_axes_line_ticks()
@jonocarroll
Copy link
Owner

Cheers. Is the idea here to add some spelled-out aliases for particular arguments?

library(ggplot2)
ggplot(mtcars, aes(wt, mpg)) +
  geom_point() + 
  theme_classic() +
  ggeasy::easy_remove_x_axis(what = c("ticks", "line"))

would use

ggeasy::easy_remove_x_axis_ticks_line()

I'm on the fence on that one. We did add aliases for many of the which = ["x"|"y"] arguments but it relies on the user starting with knowing the axis they want to modify. Autocomplete on the which argument shows the available values (since we have that in the signature) (at least in RStudio).

Part of my hesitation is relying on the argument order to autocomplete - if we want to support arbitrary order then we'd need every permutation. The which argument currently has 4 possible values. Extending those would require extending all the permuatations.

The feature ideas are all great (and most welcome) I just need to find the time to implement them. If you'd like to have a go yourself a PR would be most welcome.

@davidhodge931
Copy link
Author

Hmm, yeah you are prob right re not doing permutations, as many others would be equally valid to do.

What's your feeling on the rest of the proposed functions that would just remove one component of the axes? I think they would be super handy

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