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

Create a ojo_scales() function that will automatically format the scales with defaults based on variable names #3

Open
andrewjbe opened this issue Oct 31, 2024 · 2 comments
Assignees

Comments

@andrewjbe
Copy link
Contributor

I'm envisioning this working along the lines of:

my_data |>
   ggplot(aes(x = date_var, y = dollar_var) +
   geom_line() +
   ojo_scales() +
   theme_okpi()

and ojo_scales() would automatically detect that the x variable is a date, and the y variable is a dollar amount, and it would apply scale_manual_date() and scale_manual_continuous(labels = scales::dollar), etc.

@andrewjbe andrewjbe self-assigned this Oct 31, 2024
@andrewjbe
Copy link
Contributor Author

@anthonyokc
Copy link
Contributor

I don't believe we can make this a default elsewhere, so could make sense to add here, the default expand argument should be scale_*(expand = expand_scale(mult = c(0, .1)) which creates no space below the bars and the x-axis but expands the scale to 10% above the highest bar plot.

Like this here

referrals_adjudication_population_by_race_2018

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