scale_fill_pprabhu: Scales for ggplot2 : scale_fill function

Description Usage Arguments Examples

View source: R/colorscales.r

Description

Applies your custom color scales as fill aesthetics

Usage

1
2
scale_fill_pprabhu(..., palette = "main", discrete = TRUE,
  reverse = TRUE)

Arguments

...

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?

Examples

 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)

pavitrasprabhu/DVIZ-ADDON documentation built on July 2, 2020, 6:26 p.m.