use_pal: Large collection of colour palettes for your ggplots

View source: R/use_pal.R

use_palR Documentation

Large collection of colour palettes for your ggplots

Description

Choose a colour palette out of a huge collection of famous colour palettes from popular brands and topics. This allows you easily to adjust your ggplot to your design.

Usage

use_pal(name = NULL, n = NULL, type = c("discrete", "continuous"))

Arguments

name

Name of the brand or topic you want as colour palette

n

Number of colors that should be used. If empty, all colours of the palette are selected

type

Can be either "continuous" or "discrete". You can use "continous" if you want to automatically interpolate between the palette's colours.

Details

Selection of possible available brands and topics:

  • airfrance: Air France colour palette

  • fivethirtyeight: Colour palette of the analytics blog 538

  • porsche: Porsche colour palette

  • porsche_black: Porsche colour palette in grey

  • ...

Take a look at the online documentation for a complete overview of colour palettes or run list_pals().

Value

A vector with hexcodes to use in ggplot etc.

Examples

library("ggplot2")
ggplot(mtcars, aes(factor(cyl), fill=factor(vs))) +
geom_bar() +
scale_fill_manual(values = use_pal(name="porsche"))

#List all available colour palettes
list_pals()

dominikjung42/dstools documentation built on June 16, 2024, 2:40 a.m.