use_pal | R Documentation |
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.
use_pal(name = NULL, n = NULL, type = c("discrete", "continuous"))
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. |
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()
.
A vector with hexcodes to use in ggplot
etc.
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()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.