Description Usage Arguments Examples
Applies your custom color scales as fill aesthetics
1 2 | scale_fill_pprabhu(..., palette = "main", discrete = TRUE,
reverse = TRUE)
|
... |
additional arguments to pass to scale_fill_gradientn |
palette |
Choose from 'pprabhu_palettes' list |
discrete |
whether to use a discrete/continuous colour palette |
reverse |
logical input, Do you want to reverse the order of colors? |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | library(ggplot2)
# Create some variables
x <- 1:9 * 2
y <- 1:9 * 1
xy <- data.frame(x,y)
# Plots a histogram with discrete fill using "div" palette
ggplot(xy,aes(x=x,y=y,fill=as.character(y))) +
geom_bar(stat="identity") +
scale_fill_pprabhu(palette = "div")
# Plots a histogram with continious fill using "hot" palette
ggplot(xy, aes(x = x)) +
geom_histogram(aes(fill = ..count..), binwidth = 5) +
scale_fill_pprabhu(palette = "hot",discrete=FALSE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.