-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Closed
Labels
guides 📏messagesrequests for improvements to error, warning, or feedback messagesrequests for improvements to error, warning, or feedback messages
Description
The direction
argument of guide_*()
functions can only be "horizontal" or "vertical". At present an unhelpful error message is returned in case of error:
library("ggplot2")
ggplot(quakes,
aes(x = long,
y = lat,
colour = mag)) +
geom_point() +
guides(colour = guide_colorbar(direction = "horiz"))
#> Error in if (!g$title.position %in% c("top", "bottom", "left", "right")) {: argument is of length zero
In line with the tidyverse style guide an error like this would be more suitable:
library("ggplot2")
ggplot(quakes,
aes(x = long,
y = lat,
colour = mag)) +
geom_point() +
guides(colour = guide_colorbar(direction = "horiz"))
#> Error: The direction argument of guide_colorbar() must be either "vertical" or "horizontal"
Metadata
Metadata
Assignees
Labels
guides 📏messagesrequests for improvements to error, warning, or feedback messagesrequests for improvements to error, warning, or feedback messages