-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Confusing error when theme(legend.direction = .)
incorrectly entered
#4930
Comments
Thanks, that is indeed an inelegant error message. After #4879 gets merged, this will return the following error message:
Quoting from the tidyverse style guide:
So I don't think there is a good chance that ggplot2 will allow this as a partially matched argument. |
I just realised that this is a duplicate of #4364, so I'll close this issue in favour of the other one. |
The guide system, as the last remaining chunk of ggplot2, has been rewritten in ggproto. The axes and legends now inherit from a <Guide> class, which makes them extensible in the same manner as geoms, stats, facets and coords (#3329, @teunbrand). In addition, the following changes were made: * Styling theme parts of the guide now inherit from the plot's theme (#2728). * Styling non-theme parts of the guides accept <element> objects, so that the following is possible: `guide_colourbar(frame = element_rect(...))`. * Primary axis titles are now placed at the primary guide, so that `guides(x = guide_axis(position = "top"))` will display the title at the top by default (#4650). * Unknown secondary axis guide positions are now inferred as the opposite of the primary axis guide when the latter has a known `position` (#4650). * `guide_colourbar()`, `guide_coloursteps()` and `guide_bins()` gain a `ticks.length` argument. * In `guide_bins()`, the title no longer arbitrarily becomes offset from the guide when it has long labels. * The `order` argument of guides now strictly needs to be a length-1 integer (#4958). * More informative error for mismatched `direction`/`theme(legend.direction = ...)` arguments (#4364, #4930). * `guide_coloursteps()` and `guide_bins()` sort breaks (#5152).
When running
ggplot()
with a legend and usingtheme(legend.position = .)
to change the legend direction, an invalid argument causes an unclear error. I also feel like abbreviations should be allowed for this argument since it only accepts two strings.The text was updated successfully, but these errors were encountered: