You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
More configurable continuous colorscale defaults #3827
scale_[fill/colour]_[continuous/binned] have a type argument which provides an entrypoint for customizing the scale's default. Currently, type only supports gradient and viridis. It seems reasonable that it could also support an arbitrary function, which would make the default much more configurable. For example:
The issue has been closed, but the example above is still not working with the provided syntax in my session (R4.0 ggplot2 3.3.1), returning the followign error:
> library(ggplot2)
> scale_colour_custom <- function(...) {
+ scale_colour_gradient(..., low = "white", high = "green")
+ }
> options(ggplot2.continuous.colour = scale_colour_custom)
> qplot(1:10, 1:10, color = 1:10)
Error in switch(type, gradient = scale_colour_gradient(...), viridis = scale_colour_viridis_c(...), :
EXPR must be a length 1 vector
If a different syntax is needed, could you please provide an example?
Activity
Type argument in scale_[fill/colour]_[continuous/binned] can accept a…
Type argument in scale_[fill/colour]_[continuous/binned] can accept a…
Type argument in scale_[fill/colour]_[continuous/binned] can accept a…
cpsievert commentedon May 19, 2020
Done in #3828
fcecinati commentedon Apr 1, 2021
The issue has been closed, but the example above is still not working with the provided syntax in my session (R4.0 ggplot2 3.3.1), returning the followign error:
If a different syntax is needed, could you please provide an example?
Screenshot of my sessionInfo()
