我有一组价值观,比如(想象一下这些都是小部件销售):
year | Sarah | Elizabeth | Jones | Robert |
-------------------------------------------
2003 | 11 | 0 | 0 | 0 |
2004 | 16 | 0 | 0 | 6 |
2005 | 12 | 0 | 4 | 11 |
2006 | 33 | 0 | 0 | 3 |
2007 | 18 | 0 | 0 | 0 |
2008 | 18 | 0 | 0 | 0 |
2009 | 110 | 0 | 0 | 0 |
2010 | 83 | 0 | 0 | 0 |
2011 | 1553 | 20 | 25 | 0 |
2012 | 785 | 27 | 0 | 186 |
2013 | 561 | 73 | 0 | 3 |
我用seaborn和matplotlib做了一个热图,但是不幸的是,大量的数字占据了主导地位,所以它看起来就像是一个非常黑暗的方块,在非常苍白的方块中。在
有没有一种方法可以用分段函数进行颜色映射,例如,将由[0,200],然后(550,1600]组成的整个范围映射成一个线性的、连续的颜色值?不幸的是,到目前为止我看到的所有颜色贴图都是预先设置好的。在
似乎您正在为Colormap Normalization寻找discrete bounds方法。下面是一个使用您的数据的示例:
相关问题 更多 >
编程相关推荐