Try something like below (there may be better ways to iterate over
indices but the below is what I can think of now).
-JJ
idxy, idxx = np.indices(tmat.shape)
for ix, iy in zip(idxx.flat, idxy.flat):
text(ix-0.5, iy+0.5, "%4.1f"%tmat[iy, ix],
fontsize=12,color='b',name='serif')
On T
Friends,
I have a matrix which i plotted with matshow as follows and then used text
function to write the each value inside the figure by choosing x and y
coordinate. I wish to know if there is any easy or more fancy way to do the
same.
*mat=load('tnz.txt')*
In [3]: *tmat=transpose(mat)*
In [4]: