Description Usage Arguments Value Examples
Add manual fill-color assignment for both categorical and numerical variable
1 2 3 4 5 6 7 | sp_manual_fill_ggplot2(
p,
data,
color_variable,
manual_color_vector = NULL,
alpha = 1
)
|
p |
A ggplot2 object |
data |
Data matrix used for the ggplot2 object |
color_variable |
Name of columns for color assignment |
manual_color_vector |
Manually set colors for each geom. Default NULL, meaning using ggplot2 default. Colors like c('red', 'blue', '#6181BD') (number of colors not matter) or a RColorBrewer color set like "BrBG" "PiYG" "PRGn" "PuOr" "RdBu" "RdGy" "RdYlBu" "RdYlGn" "Spectral" "Accent" "Dark2" "Paired" "Pastel1" "Pastel2" "Set1" "Set2" "Set3" "Blues" "BuGn" "BuPu" "GnBu" "Greens" "Greys" "Oranges" "OrRd" "PuBu" "PuBuGn" "PuRd" "Purples" "RdPu" "Reds" "YlGn" "YlGnBu" "YlOrBr" "YlOrRd" (check http://www.sthda.com/english/wiki/colors-in-r for more). |
alpha |
Transparency |
A ggplot2 object
1 2 3 4 | ## Not run:
p <- sp_manual_fill_ggplot2(p, data, color_variable, manual_color_vector)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.