-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Warning message when adding a manual scale in ggplot #3127
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
Comments
Would you mind turning this into a reprex (short for minimal reproducible example)? It's especially helpful for ggplot2, since it automatically generates and uploads the plots (or lack thereof), which makes it much easier to go through at a glance. If you've never heard of a reprex before, you might want to start by reading the tidyverse.org help page. reprex is automatically installed with the tidyverse package, but if you don't have it, you can run install.packages("reprex") If you run into problems with access to your clipboard, you can specify an outfile for the reprex, and then copy and paste (or drag and drop) the contents here. reprex::reprex(input = "fruits_stringdist.R", outfile = "fruits_stringdist.md") Thanks |
You can take the comment above as a "for future reference", since I just ran your code through reprex (below) library(ggplot2)
d <- data.frame(week = seq(1, 52, 1),
revenue = round(runif(52, 0, 100)), 0)
p <- ggplot(data = d, aes(x = week, y = revenue, fill = 'lightskyblue')) +
geom_bar(stat = 'identity', colour = 'black')
p <- p + scale_fill_identity(name = NULL,
guide = guide_legend(label.position = 'top'),
labels = c('2019'))
p
#> Warning in if (self$guide == "none") return(): the condition has length > 1
#> and only the first element will be used Created on 2019-02-11 by the reprex package (v0.2.1) Suggested fix from SO answer:
|
* properly check for presence/absence of guide. Closes #3127. * use `identical()` instead of `isTRUE()`.
This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/ |
On Stackoverflow they suggested to report my question as a bug, so here it is:
When I add a manual scale like in the example below. I get the following error message:
"Warning message: In if (self$guide == "none") return() : the condition has length > 1 and only the first element will be used"
The text was updated successfully, but these errors were encountered: