Package 'painbow'

Title: Use XKCD's "Painbow" Colormap and Dataset in ggplot2
Description: XKCD described a supposedly "bad" colormap that it called a "Painbow" (see <https://xkcd.com/2537/>). But simple tests demonstrate that under some circumstances, the colormap can perform very well, and people can find information that is difficult to detect with the ggplot2 default and even supposedly "good" colormaps like viridis. This library let's you use the Painbow in your own ggplot graphs.
Authors: Steve Haroz
Maintainer: Steve Haroz <[email protected]>
License: MIT + file LICENSE
Version: 1.0.1
Built: 2024-11-09 03:06:58 UTC
Source: https://github.com/steveharoz/painbow

Help Index


An array of colors from XKCD's painbow comic

Description

This set of 192 colors is the Painbow. The colors were extracted using the pixels from the color bar on the right side of the comic.

Usage

painbow_colors

Format

An array with 192 hex color strings.

Source

https://xkcd.com/2537/


A 2D heatmap from XKCD's painbow comic

Description

A 2D heatmap from XKCD's painbow comic

Usage

painbow_data

Format

A data frame with 58,425 rows and 3 variables:

x

x-axis position

y

y-axis position

value

A value from 0 to 1

Source

https://xkcd.com/2537/


Painbow colormap

Description

Use XKCD's "Painbow" colormap

Usage

scale_color_painbow(...)
scale_colour_painbow(...)
scale_fill_painbow(...)

Arguments

...

Any arguments are passed to ggplot2:scale_fill_gradientn()

Details

The colors were extracted directly from the colorscale in XKCD's image (https://xkcd.com/2537/).

Author(s)

Steve Haroz

See Also

See ggplot2:scale_fill_gradientn() for additional arguments.

Examples

# You can use it for continuous data
library(ggplot2)
ggplot(faithfuld) +
  aes(waiting, eruptions, fill = density) +
  geom_tile() +
  scale_fill_painbow()