RColorBrewer允许您获得少量视觉上令人愉悦的颜色,如下所示:
> library(RColorBrewer) > brewer.pal(11, "Spectral") [1] "#9E0142" "#D53E4F" "#F46D43" "#FDAE61" "#FEE08B" "#FFFFBF" "#E6F598" [8] "#ABDDA4" "#66C2A5" "#3288BD" "#5E4FA2"
但是如果你要求超过这个金额,他们只会给你相同的最大金额:
> 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
如果提供更大的数字,是否可以获得更多的颜色(可能通过在最远的颜色之间插值)?