Beyonce
:crown: :bee: :bar_chart: Beyoncé colour palettes for R
Install / Use
/learn @dill/BeyonceREADME
<!-- README.md is generated from README.Rmd. Please edit that file -->
Beyoncé Palettes
This is a shameless theft/mashup of:
- Brendan Hurr's idea (also Karthik's) from Noam Ross's tweet
- Code from Karthik Ram's
wesandersonpalette - Foremost: the 130 amazing palettes from beyoncepalettes.tumblr.com
Note: I am (red-green) colourblind. I have no idea whether these colours make sense for data visualisation. Maybe use viridis if you want people like me to be able to see your plots :)
Installation
devtools::install_github("dill/beyonce")
Usage
library(beyonce)
par(mfrow=c(26,5))
for(i in 1:130) print(beyonce_palette(i))
<img src="figure/all_palettes-1.png" title="" alt="" width="480" />
library(ggplot2)
ggplot(iris, aes(Sepal.Length, Sepal.Width, color = Species)) +
geom_point(size = 3) +
scale_color_manual(values = beyonce_palette(18)) +
theme_gray()
<img src="figure/iris_ex-1.png" title="" alt="" width="672" />
qplot(factor(cyl), data=mtcars, geom="bar", fill=factor(vs)) +
scale_fill_manual(values = beyonce_palette(72))
<img src="figure/mtcars_ex-1.png" title="" alt="" width="672" />
pal <- beyonce_palette(123, 21, type = "continuous")
image(volcano, col = pal, asp=1)
<img src="figure/volcano_ex-1.png" title="" alt="" width="480" />
pal <- beyonce_palette(3, 100, type = "continuous")
# heatmap is a local dataset
ggplot(heatmap, aes(x = X2, y = X1, fill = value)) +
geom_tile() +
scale_fill_gradientn(colours = pal) +
scale_x_discrete(expand = c(0, 0)) +
scale_y_discrete(expand = c(0, 0)) +
coord_equal()
<img src="figure/heatmap_ex-1.png" title="" alt="" width="672" />
With apologies, DLM
Related Skills
node-connect
349.0kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
109.4kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
349.0kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
349.0kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
