Can anyone help me understand this: the code below produces a plot in which the x and y axis labels are reversed relative to the direction in which z varies on the plot, although the gradient arrows are correctly oriented. Is there something I've missed in understanding the sense of the x and y directions in mgrid, imshow, and gradient?
""" x,y axes seem to be reversed """ import numpy as np from matplotlib.pylab import * dx = .25; dy = .25 xlen = 2.0; ylen = 2.0 x,y = np.mgrid[-xlen:xlen:dx, -ylen:ylen:dy] #also works with ogrid z = x hold(True) imshow(z, origin='lower', extent=[-xlen,xlen,-ylen,ylen]) colorbar() [u,v] = np.gradient(z) u /= dx; v /= dy QP = quiver(x,y,u,v,pivot='middle',color=[0.5,0.5,0.5]) quiverkey(QP, 0.85, 1.05, 1.0, '1 unit', labelpos='N') xlabel('x') ylabel('y') title('slope') show() ------------------------------------------------------------------------------ Index, Search & Analyze Logs and other IT data in Real-Time with Splunk Collect, index and harness all the fast moving IT data generated by your applications, servers and devices whether physical, virtual or in the cloud. Deliver compliance at lower cost and gain new business insights. Free Software Download: http://p.sf.net/sfu/splunk-dev2dev _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users