scale_fill_binary | R Documentation |
Provides exactly two colors from the viridis magma palette (red and purple)
scale_fill_binary(direction = 1, ...)
direction |
Order of colors, 1: purple-red. -1: red-purple, Default: 1 |
... |
Additional arguments to be passed to ggplot2::discrete_scale |
The default top level from the discrete viridis scale is bright yellow, which is too bright. This scale uses red for top level.
a fill scale to be used with ggplot2
discrete_scale
magma
## Not run:
if(interactive()){
ggplot(mtcars, aes(mpg, fill=factor(am))) + geom_histogram() + scale_fill_binary()
}
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.