Hello, I am trying to set tick labels for a matshow plot. This works just fine if I only work on the X axis:
res = np.diag(np.arange(10)) # dummy data modes = [ (x+1, 0) for x in range(5) ] # dummy data fig = plt.figure() ax = fig.add_subplot(111) cs = ax.matshow(res) fig.colorbar(cs, ticks=np.arange(0,-10,-1), shrink=0.8) ax.set_xticklabels(['%d/%d' % (x[1], x[0]) for x in modes]) ax.set_xticks(2*np.arange(len(modes))+0.5) but if I try to do the same think with the Y axis, everything looks messed up (e.g. the matrix is no longer square): ax.set_yticklabels(['%d/%d' % (x[1], x[0]) for x in modes]) ax.set_yticks(2*np.arange(len(modes))+0.5) What am I doing wrong? Thanks, -Nikolaus -- »Time flies like an arrow, fruit flies like a Banana.« PGP fingerprint: 5B93 61F8 4EA2 E279 ABF6 02CF A9AD B7F8 AE4E 425C ------------------------------------------------------------------------------ Nokia and AT&T present the 2010 Calling All Innovators-North America contest Create new apps & games for the Nokia N8 for consumers in U.S. and Canada $10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store http://p.sf.net/sfu/nokia-dev2dev _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users