Screenshot instructions:
Windows
Mac
Red Hat Linux
Ubuntu
Click URL instructions:
Rightclick on ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)
From: Brian Larsen <balarsen@bu...>  20091128 14:34:50

Hello all, several of my colleagues and I are 99% sure we are making the change from IDL to pythonmatplotlib. I have just one issue that I am trying to work out that I need to solve. We are so far really impressed and looking forward to the change. I have seen discussion on this list about imagesc and imshow but none of them have quite answered the questions. In IDL we spent way too much time writing an clone that is still not full featured: http://people.bu.edu/balarsen/IDLdoc/imagesc.html I have data of probability distributions which have an X and Y array associated with the axes of the 2d distribution (image). What I don't see how to do in any easy fashion is plot this data in a imshow() manner with the axes correct (which are unevenly distributed and need to be plotted on a log axes). This can be done with contourf(X,Y,Z) but this has a few issues:  I dont see how to do a log axes on a contour  contour is the wrong plot as the inherent smoothing that a contour does is highly undesirable. Using matlab imagesc one can easily make plots similar to: http://img269.yfrog.com/i/2dprob.png/ Imagine taking the above plot and make the "pixels" different sizes so that each "pixel" has identical counting statistics. Now assume that one wanted the Yaxis to be plotted in log. Anyone have any thoughts or toy examples? Thanks much, Brian   Brian A Larsen RBSPECT Instrument Suite Scientist Boston University Center for Space Physics 725 Commonwealth Ave, Rm 506 Boston, MA 022151401 T: 6173584945 F: 6173536463 balarsen at  bu.edu 
From: Eric Firing <efiring@ha...>  20091128 18:03:00

Brian Larsen wrote: > Hello all, > > several of my colleagues and I are 99% sure we are making the change from IDL to pythonmatplotlib. I have just one issue that I am trying to work out that I need to solve. We are so far really impressed and looking forward to the change. > > I have seen discussion on this list about imagesc and imshow but none of them have quite answered the questions. In IDL we spent way too much time writing an clone that is still not full featured: > http://people.bu.edu/balarsen/IDLdoc/imagesc.html > > I have data of probability distributions which have an X and Y array associated with the axes of the 2d distribution (image). What I don't see how to do in any easy fashion is plot this data in a imshow() manner with the axes correct (which are unevenly distributed and need to be plotted on a log axes). > > This can be done with contourf(X,Y,Z) but this has a few issues: >  I dont see how to do a log axes on a contour >  contour is the wrong plot as the inherent smoothing that a contour does is highly undesirable. > > Using matlab imagesc one can easily make plots similar to: > http://img269.yfrog.com/i/2dprob.png/ > Imagine taking the above plot and make the "pixels" different sizes so that each "pixel" has identical counting statistics. Now assume that one wanted the Yaxis to be plotted in log. > > Anyone have any thoughts or toy examples? I am not sure I understand exactly what you want to do, but it sounds like pcolormesh would do it. e.g. with ipython pylab: ax = gca() ax.set_yscale('log') x = np.arange(10)**1.5 y = np.arange(20)**1.8 z = x[1:] * y[1:, np.newaxis] pcolormesh(x, y, z) axis('tight') Note that with x and y, which can be 1D or 2D, you are specifying the grid boundaries, not the pixel centers. Eric 
Sign up for the SourceForge newsletter:
No, thanks