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 |
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.
painbow_colors
painbow_colors
An array with 192 hex color strings.
A 2D heatmap from XKCD's painbow comic
painbow_data
painbow_data
A data frame with 58,425 rows and 3 variables:
x-axis position
y-axis position
A value from 0 to 1
Use XKCD's "Painbow" colormap
scale_color_painbow(...) scale_colour_painbow(...) scale_fill_painbow(...)
scale_color_painbow(...) scale_colour_painbow(...) scale_fill_painbow(...)
... |
Any arguments are passed to |
The colors were extracted directly from the colorscale in XKCD's image (https://xkcd.com/2537/).
Steve Haroz
See ggplot2:scale_fill_gradientn()
for additional arguments.
# You can use it for continuous data library(ggplot2) ggplot(faithfuld) + aes(waiting, eruptions, fill = density) + geom_tile() + scale_fill_painbow()
# You can use it for continuous data library(ggplot2) ggplot(faithfuld) + aes(waiting, eruptions, fill = density) + geom_tile() + scale_fill_painbow()