Suresh Pillai wrote:
Great, matshow() works for my requirements.
Although, I must comment that its placement of tickbars seems inappropriate for a matrix visualisation. For example, for the following simple example:
import pylab
matrix = pylab.array([[1,2,3],[4,5,6],[1,1,4]])
pylab.matshow(matrix, cmap=pylab.cm.gray)
pylab.show()
tick marks and labels are produced for [0.5,1.5,2.5] in addition to the appropriate integral ones. It's obviously not an issue for larger matrices.
I agree, and this is a problem with spy also. If I remember, I will fix it. It is only a minor annoyance, so it is low priority, though.
There is a difference in the way the axes are labeled between spy and matshow, and I would like to change matshow to agree with spy, unless there is an outcry to the contrary. Specifically, I think the integer axis ticks should land in the middle of a given row or column, not on the edge. To see what I mean, compare
xx = zeros((3,3))
xx[1,1] = 1
spy(xx, marker='s')
to
matshow(xx)
Maybe this is exactly what you mean by your next statement?
Further, I would think a setting like align='center' in pylab.bar() would be appropriate. Any simple way of doing this without manually setting the ticks and labels (ironically using forced *.5 ticks)?
Eric