library(mandelbrot)
library(RColorBrewer)
set.seed(43121)
plot_mandelbrot <- function(colors, transform, iteration=8, resolution=4096){
mbview <- mandelbrot(
xlim=c(-2,2), ylim=c(-2,2),
resolution=resolution, iteration=iteration
)
cols <- mandelbrot_palette(colors, fold=FALSE)
plot(mbview, col=cols)
}
…and fun to look at.
brewer_info <- RColorBrewer::brewer.pal.info
palette_names <- rownames(brewer_info)
maxcolors <- brewer_info$maxcolors
for(i in 1:nrow(brewer_info)){
plot_mandelbrot(
RColorBrewer::brewer.pal(maxcolors[i], palette_names[i]), "inv",
iteration=11, resolution=1024
)
}
plot_mandelbrot(RColorBrewer::brewer.pal(11, "Paired"), "inv")