RColorBrewer extension to support more colors?

RColorBrewer allows you to get a small number of visually pleasing colors:

> library(RColorBrewer) > brewer.pal(11, "Spectral") [1] "#9E0142" "#D53E4F" "#F46D43" "#FDAE61" "#FEE08B" "#FFFFBF" "#E6F598" [8] "#ABDDA4" "#66C2A5" "#3288BD" "#5E4FA2" 

But if you ask for more than this amount, they will just give you the same maximum amount:

 > brewer.pal(12, "Spectral") [1] "#9E0142" "#D53E4F" "#F46D43" "#FDAE61" "#FEE08B" "#FFFFBF" "#E6F598" [8] "#ABDDA4" "#66C2A5" "#3288BD" "#5E4FA2" Warning message: In brewer.pal(12, "Spectral") : n too large, allowed maximum for palette Spectral is 11 Returning the palette you asked for with that many colors 

Is it possible to get more colors (perhaps by interpolating between the most distant colors) if more are supplied?

+5
source share

Source: https://habr.com/ru/post/1237462/


All Articles