scale_fill_discrete: Scale fill discrete with SGB-colors

Description Usage Arguments See Also Examples

View source: R/scales.R

Description

Overwrites the default discrete fill scale with SGB-palette pal_sgb_pref. To use another palette or custom colours, use scale_fill_manual().

Usage

1

Arguments

...

parameters passed on to scale_fill_manual().

See Also

Other colour scales: scale_colour_discrete(), scale_colour_gradient(), scale_fill_gradient()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
## Not run: 
library(ggplot2)
library(gsgb)
theme_set(theme_sgb(base_size = 9))

ggplot(mpg, aes(as.factor(year), fill = drv)) +
  geom_bar(position = "dodge") +
    labs(x = "", y = "")

# This gives the same:
ggplot(mpg, aes(as.factor(year), fill = drv)) +
  geom_bar(position = "dodge") +
    labs(x = "", y = "") +
  scale_fill_discrete()

# To change fill scale:
ggplot(mpg, aes(as.factor(year), fill = drv)) +
  geom_bar(position = "dodge") +
    labs(x = "", y = "") +
 scale_fill_manual(values = rev(usecol(pal_sgb_dunkelblau)))

## End(Not run)

SchweizerischerGewerkschaftsbund/gsgb documentation built on Dec. 18, 2021, 1 p.m.