On Tue, Jun 13, 2006 at 06:21:22AM -0500, John Hunter wrote: > setting the xscale and yscale to 'log' should work fine, as long as > you make sure the xaxis and yaxis do not contain nonpositive limits. > For an MxN image, the default limits are 0..N-1 and 0..M-1 and the 0 > will break the log transform. You can work around this by setting the > image "extent" > > from pylab import figure, show, nx > fig = figure() > ax = fig.add_subplot(111) > im = nx.mlab.rand(500,500) > ax.imshow(im, extent=(1,501,1,501))
I often want to plot matrices, with the axes labeled according to the matrix index. I.e. the top-lefthand element should be (0,0) and the bottom-righthand element (rows,columns). Setting the extent does work, i.e. ax.imshow(im,extent=(1,columns,rows,1)) If others also use this frequently, it may be useful to have a quick way of doing it (or maybe, there already is, and I've missed it). Regards Stéfan _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users