-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Using scale_fill_continuous(breaks=NULL) results in error #579
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
0.9.1 also results in error. |
The error in master (1df1e82) is this: dat <- data.frame(x=1:3, y=1:3)
ggplot(dat, aes(x=1, y=y, fill=x)) + geom_point(shape=21) + scale_fill_continuous(breaks=NULL)
# Error in names(guide$key) <- c(output, ".label", ".value") :
# 'names' attribute [3] must be the same length as the vector [2]
ggplot(dat, aes(x=1, y=y, colour=x)) + geom_point() + scale_colour_continuous(breaks=NULL)
# Error in names(guide$key) <- c(output, ".label", ".value") :
# 'names' attribute [3] must be the same length as the vector [2] Also, this gives a warning: ggplot(dat, aes(x=1, y=y, size=x)) + geom_point() + scale_size_continuous(breaks=NULL)
# Warning message:
# In is.na(breaks) : is.na() applied to non-(list or vector) of type 'NULL' |
I mean that these errors and warnings also happen in the released version 0.9.1. I'm sure why this error happens. Should it be simply ignored, with some warning message? |
In 0.9.1, I get warnings only, but no errors. ggplot(dat, aes(x=1, y=y, colour=x)) + geom_point() + scale_colour_continuous(breaks=NULL)
# Warning message:
# In is.na(breaks) : is.na() applied to non-(list or vector) of type 'NULL' Maybe it should not show the legend when |
yes, but in 0.9.1,
So the bug(?) is not due to changing the colorbar as default.
I agree. Do you think there is a situation where someone want to show colorbar without tick/lables? |
So possible solution for
The warning message should be like:
|
Oh, I see what you mean. Yes, the bug is in colorbar. |
ah..., if the branch referring the issue is merged on github, those who commit the branch will close the issue, I understand. |
Some of the visual tests in visual_test/scale-breaks.r now throw errors. This was introduced by e6594a1, where the colorbar guide started being used as the default.
Here are the two bad tests:
We should also have some unit tests for this...
The text was updated successfully, but these errors were encountered: