我有一个时间表,可能有很多系列,20 +并不罕见。 d3带有内置的category10调色板,因为颜色不同,所以你可以将一个系列与另一个系列区分开来。
https://github.com/mbostock/d3/wiki/Ordinal-Scales#categorical-colors
虽然类别10调色板很好但是可能有一个更为确定的(因为缺少一个更好的单词)颜色数组,计算机用户发现它们具有视觉吸引力并且足够不同?
我的用例是在时间图表上显示许多系列作为彩色线条。
更新1:
第一次迭代后的10+种颜色的示例。请注意,红色和黄色不存在,因为它们通常用于阈值。
steelblue, orange, #339900, fuchsia, firebrick, deepskyblue,
darkviolet, darkgray, #C0D800, #ff5800 , violet, #00d27f, #0057e7
屏幕截图:imgur
答案 0 :(得分:2)
d3
支持up to 20。一旦你越过它,选择视觉上吸引人的独特颜色几乎是不可能的。黄金标准ColorBrewer最多只能达到12个。我曾经有一个项目,需要48个系列图。经过详尽的研究,我想出了:
[
"#00A8F0","#C0D800","#CB4B4B","#4DA74D","#9440ED",
"#4bb2c5","#eaa228","#c5b47f","#579575","#839557",
"#958c12","#953579","#4b5de4","#d8b83f","#ff5800",
"#0085cc","#c747a3","#cddf54","#fbd178","#26b4e3",
"#bd70c7","#808000","#ffa500","#f280e0","#000080",
"#ff00ff","#800080","#800000","#6ebf00","#edc240",
"#afd8f8","#cb4b4b","#4da74d","#9440ed","#3D96AE",
"#4572A7","#AA4643","#89A54E","#80699B","#DB843D",
"#DB843D","#92A8CD","#A47D7C","#B5CA92","#202020",
"#a21764","#8ab438","#3a5b87"
]
我的团队中的非开发人员对此并不满意,因为某些颜色彼此太接近。我告诉他们继续做得更好;他们永远无法......
来自数据可视化大师Edward Tufte:
从着色数据中获得的效益往往很少表明甚至 把好颜色放在一个好地方是一件很复杂的事情。的确如此 困难和微妙,避免灾难成为第一个 为信息带来色彩的原则:最重要的是,不要伤害。