grattan_scale | R Documentation |
Convenient functions to set Grattan-appropriate palettes
grattan_colour_manual( n = 0, reverse = FALSE, discrete = TRUE, faded_level = 0, faded = FALSE, palette = "full", ... ) grattan_fill_manual( n = 0, reverse = FALSE, discrete = TRUE, faded_level = 0, faded = FALSE, palette = "full", ... )
n |
Numeric. The number of levels in your colour scale. Minimum value is
1, maximum is 7. Passed to |
reverse |
Logical. FALSE by default. Setting to TRUE reverses the standard colour order. |
discrete |
Logical. TRUE by default. Setting to FALSE generates a continuous colour scale. |
faded_level |
Integer between 0 (no fade; the default) and 8 (most faded). |
faded |
Deprecated - use |
palette |
Sets the colours that will form the continuous palette when discrete = FALSE. One of:
|
... |
arguments passed to ggplot2 scales |
library(ggplot2) ggplot(data = mtcars, aes(x = wt, y = mpg, col = factor(cyl))) + geom_point() + grattan_colour_manual(n = 3) + theme_grattan()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.