View source: R/gg_color_swatches.R
gg_color_gradient | R Documentation |
scale_fill_*
mechanismThis function creates a ggplot2 object that can be directly styled by adding
a scale_fill_*
expression. Thus, this function is particularly useful to visualize
existing ggplot2 color scales.
gg_color_gradient(n = 200, ymargin = 0, title = NULL,
title_size = 14, title_family = "", title_face = "plain",
plot_margin = margin(title_size/2, title_size/2, title_size/2,
title_size/2))
n |
Number of distinct color slices to be drawn |
ymargin |
Fraction of each swatch to be used as margin in the y direction |
title |
Optional title to print above the color swatches. Can also be provided via ggtitle. |
title_size |
Font size of the title |
title_family |
Font family of the title |
title_face |
Font face of the title |
plot_margin |
Margin around the plot, specified via the ggplot2 function margin |
gg_color_gradient() + ggtitle("Default ggplot2 continuous color scale")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.