I'm trying to plot eigenbehaviors with matplotlib, basically I have a 2D matrix and would like to plot it with something very similar to a heat map, but the cells are divided and recognizable. See for example:
Asked
Active
Viewed 736 times
6
-
apparently they got it without it ;) – marcorossi May 25 '12 at 23:30
-
1Yes ;) +1 to you and to them! – daedalus May 26 '12 at 06:02
1 Answers
7
Is this what you are after?
from pylab import *
z = rand(10, 25)
c = pcolor(z)
set_cmap('hot')
colorbar()
c = pcolor(z, edgecolors='w', linewidths=1)
axis([0,25,0,10])
savefig('plt.png')
show()

fraxel
- 34,470
- 11
- 98
- 102
-
2On a side note, `pcolormesh` is a better choice (performance-wise) for a regular grid. `pcolor` is slower, but will handle arbitrary meshes. – Joe Kington May 25 '12 at 20:13
-
1thanks, that's exactly what i'm after. this should actually be one of the examples in matplotlib's docs. – marcorossi May 25 '12 at 23:29
-