-
Notifications
You must be signed in to change notification settings - Fork 37
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
Custom breaks with facetted_pos_scales returns error #91
Comments
Oh, I'm sorry. I looked again at the documentation and realised I should be using |
Yep, that's right. Perhaps the error message should be a little more helpful on this. |
Thanks. Perhaps a slight edit to the manual text for I also noticed that even when I set the breaks, sometimes the first or last values are missing. Is it possible to force a tick mark to show at 0, for example? |
Yeah that should be possible by including 0 in the limits. If you have no negative values, you can use While 'axes' sound more intuitive, 'position scales' as a term in ggplot2 is what is really being altered, so I'm not keen on changing the terms away from what ggplot2 uses. |
Error should now read more informative text: devtools::load_all("~/packages/ggh4x")
#> ℹ Loading ggh4x
#> Loading required package: ggplot2
ggplot(mpg, aes(displ, hwy)) +
geom_point() +
facetted_pos_scales(x = list(scale_y_continuous()))
#> Error in `facetted_pos_scales()`:
#> ! The `x` argument should be "NULL", or a list of formulas and/or
#> position scales with the x aesthetic. Created on 2023-03-28 with reprex v2.0.2 |
* Attempt to update pkgdown part 2 * Drop dependency on digest * Adapt to upcoming ggplot2 #95 * Better message in facetted_pos_scales #91 * try_require() -> check_installed() * Use {cli} for messages * Add `inv` option * Fix #97 * Smarter omission of fixed scales * Better removal of spurious whitespace * Add scale_{x/y}_manual * Polish news * Mark scale_{x/y}_manual as experimental * Last polishes
Hi,
Many thanks for ggh4x, it's great. I want to create custom breaks in a 40 panel plot I've created with facet_grid2. Each panel needs custom x breaks. Following an answer on SO I created a list with my custom breaks like so:
And refer to the list in the ggplot call:
+ facetted_pos_scales(y = CUSTOM.BREAKS)
but this returns:
I must be referring to the panels incorrectly. I'm unclear how I could refer to the individual panels directly in
facetted_pos_scales
, the help file refers to only rows or columns. Please could you give some direction on how to set the breaks for each the indivudal panel? Many thanks.The text was updated successfully, but these errors were encountered: