Learn R Programming

palettetown (version 0.1.1)

scale_colour_poke: Add a pokemon palette to a ggplot2 colour or fill scale.

Description

Get a pokemon palette by either giving a pokemon number or name.

Usage

scale_colour_poke(..., pokemon = 1, spread = NULL)
scale_fill_poke(..., pokemon = 1, spread = NULL)
scale_color_poke(..., pokemon = 1, spread = NULL)

Arguments

...
Other arguments passed on to discrete_scale to control name, limits, breaks, labels and so forth.
pokemon
An integer or character pokemon name
spread
How many, quite distinct, colours should be returned. See details.

Details

If spread is given an integer, the full palette is clustered into that many groups (ward clustering in HSV space). The most common colour in each cluster is then returned. It is hoped this will give a good balance between reflecting the pokemons colouring while giving relatively distinct colours.

Examples

Run this code
library(ggplot2)
qplot(Sepal.Length, Sepal.Width, colour = Species, data=iris) +
 scale_colour_poke(pokemon = 'Metapod')

Run the code above in your browser using DataLab