颜色绘制不同的颜色matplotlib
问题描述:
我使用self.ax.imshow(arr,cmap=plt.cm.Greys_r, interpolation = 'none')
正如你所看到的情节都是一样的颜色矩阵我在matplotlib绘制。 我怎样才能让情节,不同的颜色,而不是只有黑
答
正确的链接颜色的地图是:http://www.loria.fr/~rougier/teaching/matplotlib/#colormaps 您指定的春天彩色图是这样的:
self.ax.imshow(arr, cmap = plt.cm.spring, interpolation = 'none')
。
@ tcaswell当然是正确的,如果你的数据是二进制的,颜色也是二元的。颜色图给不同的z值有不同的颜色。如果你想让右下角的部分与左下角部分不同(或其他),你需要一个不同的解决方案。我猜想有一个散点图。
更改颜色映射到不是灰色的东西?颜色地图的概述可以在这里找到:http://www.loria.fr/~rougier/teaching/matplotlib/#id49 – Robbert 2013-03-12 15:59:48
@Robbert你可以张贴评论作为一个答案,如何做到这一点? – tacaswell 2013-03-12 16:08:52
可能的重复[颜色某些不同的颜色矩阵matplotlib点](http://*.com/questions/15343923/color-certain-points-a-different-color-matrix-matplotlib) – tacaswell 2013-03-12 16:12:37