Type: Package
Title: Use XKCD's "Painbow" Colormap in ggplot2
Version: 1.0.1
Author: Steve Haroz
Maintainer: Steve Haroz <painbow@steveharoz.com>
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.
License: MIT + file LICENSE
Encoding: UTF-8
LazyData: true
Imports: ggplot2
Suggests: knitr, patchwork, spelling, rmarkdown
Depends: R (≥ 2.10)
RoxygenNote: 7.1.2
Language: en-US
BugReports: https://github.com/steveharoz/painbow/issues/new
URL: https://github.com/steveharoz/painbow
NeedsCompilation: no
Packaged: 2021-11-11 14:07:41 UTC; sharo
Repository: CRAN
Date/Publication: 2021-11-11 19:40:02 UTC

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()