scale_color_pbi: Color and fill scales from Microsoft PowerBI

Description Usage Arguments Examples

View source: R/scales.R

Description

The pbi scales provide default, city park, classroom, colorblind safe, electric, high contrast, sunset and twilight color schemes from Microsoft Power BI. These are well suited to display discrete values.

The Microsoft PowerBI scales are not designed to be extended to continuous data.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
scale_color_pbi(..., palette = "classic", direction = 1, aesthetics = "colour")

scale_colour_pbi(
  ...,
  palette = "classic",
  direction = 1,
  aesthetics = "colour"
)

scale_fill_pbi(..., palette = "classic", direction = 1, aesthetics = "fill")

Arguments

...

Other arguments passed on to discrete_scale

palette

A palette name from names(pbi_palettes)

direction

Sets the order of colours in the scale. If -1, the order of colours is reversed. Defaults to 1

aesthetics

Character string or vector of character strings listing the name(s) of the aesthetic(s) that this scale works with. This can be useful, for example, to apply colour settings to the colour and fill aesthetics at the same time via aesthetics = c("colour", "fill")

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
if (require(ggplot2)) {
  ggplot(iris, aes(x = Sepal.Length, y = Sepal.Width, color = Species)) +
   geom_point(size = 4) +
   theme_bw(base_family = "mono") +
   scale_color_pbi(palette = "twilight")

  ggplot(mpg, aes(x = manufacturer, fill = manufacturer)) +
   geom_bar() +
   scale_fill_pbi(palette = "colorblind safe") +
   theme_bw(base_family = "serif") +
   labs(x = "Manufacturer",
        y = "Count",
        title = "Manufacturer Counts",
        subtitle = "Dodge is highest!")
}

keyurbipinshah/ggpowerbi documentation built on May 5, 2020, 9:23 p.m.