[Matplotlib-users] OS X Bad Aspect Ratio
Hey all, When I plot using python 2.5.2 and matplotlib 0.98.3 (and 0.98.1) I have the following problem. If I run a script from the command line that plots and saves the figure, I get the default aspect ratio of (8, 6). If, however, I close the plotting window and replot without exiting the python prompt and starting anew, the aspect changes to something like (8, 6.04). I can reliably get the (8, 6) aspect ratio if I quit the python prompt and load a new prompt. The problem only comes after I close the plot window and replot. The new aspect ratio is consistent after it first changes. That is, if I plot, close the window, replot, close the window, and replot again, the 2nd and 3rd figures would save with the same aspect ratio while the first would have the one I desire. What could be the problem? Cheers, Josh - This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Griddata
Greetings all, In using the function griddata in mlab.py, I think I have found a bug. The following line in mlab.py errors for me. I supply it an xi and yi that have shape (N,1). I have surface data, but I only care about the variation in one direction. In mlab, when it gets to this line (2956 in svn revision 7040): if min(xo[1:]-xo[0:-1]) < 0 or min(yo[1:]-yo[0:-1]) < 0: raise ValueError, 'output grid defined by xi,yi must be monotone increasing' the result is an error. That is, I get the following: ValueError: min() arg is an empty sequence A couple of things. First, if I make my variation in x to be 2 points (x = 0 for the case I'm interested in--so I just have both values of x be zero), I do not get this error and I believe the result works. So, it seems that there should be some handling of the case that there are only 1 point in either x or y direction. Second, is it better to use the builtin python function min, or should numpy.min be used instead? Cheers, Josh Lawrence Ph.D. Student Clemson University -- Stay on top of everything new and different, both inside and around Java (TM) technology - register by April 22, and save $200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco. 300 plus technical and hands-on sessions. Register today. Use priority code J9JMT32. http://p.sf.net/sfu/p ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Griddata
Jeff, Thanks for the speedy reply. Should a warning be raised then that my data (though in 2D form) is not 2D and therefore is invalid input? Cheers, Josh Lawrence Ph.D. Student Clemson University On Apr 16, 2009, at 2:53 PM, Jeff Whitaker wrote: > Josh Lawrence wrote: >> Greetings all, >> >> In using the function griddata in mlab.py, I think I have found a >> bug. The following line in mlab.py errors for me. >> I supply it an xi and yi that have shape (N,1). I have surface >> data, but I only care about the variation in one direction. In >> mlab, when it gets to this line (2956 in svn revision 7040): >> >> if min(xo[1:]-xo[0:-1]) < 0 or min(yo[1:]-yo[0:-1]) < 0: >> raise ValueError, 'output grid defined by xi,yi must >> be monotone increasing' >> >> the result is an error. That is, I get the following: >> >> ValueError: min() arg is an empty sequence >> >> A couple of things. First, if I make my variation in x to be 2 >> points (x = 0 for the case I'm interested in--so I just have both >> values of x be zero), I do not get this error and I believe the >> result works. So, it seems that there should be some handling of >> the case that there are only 1 point in either x or y direction. >> >> Second, is it better to use the builtin python function min, or >> should numpy.min be used instead? >> >> Cheers, >> >> Josh Lawrence >> Ph.D. Student >> Clemson University > > Josh: griddata currently only works for 2-D output grids. It may > be possible to modify it to work with 1-D data, but that was not the > original intent of the function. > > -Jeff > > -- > Jeffrey S. Whitaker Phone : (303)497-6313 > Meteorologist FAX: (303)497-6449 > NOAA/OAR/PSD R/PSD1Email : jeffrey.s.whita...@noaa.gov > 325 BroadwayOffice : Skaggs Research Cntr 1D-113 > Boulder, CO, USA 80303-3328 Web: http://tinyurl.com/5telg > -- Stay on top of everything new and different, both inside and around Java (TM) technology - register by April 22, and save $200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco. 300 plus technical and hands-on sessions. Register today. Use priority code J9JMT32. http://p.sf.net/sfu/p ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Documentation error/bug?
Hello, I looked on your website for the different line styles. In the documentation for matplotlib.lines.line2D.set_linestyle, the dashed linestyle is listed as '-' and not '--'. It it my understanding that dashed should be '--'. If I'm incorrect, sorry for the noise. Cheers, -- Josh Lawrence Ph.D. Student Clemson University -- The Palm PDK Hot Apps Program offers developers who use the Plug-In Development Kit to bring their C/C++ apps to Palm for a share of $1 Million in cash or HP Products. Visit us here for more details: http://ad.doubleclick.net/clk;226879339;13503038;l? http://clk.atdmt.com/CRS/go/247765532/direct/01/ ___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users