Re: [Matplotlib-users] plot with marker color coded according to z-value

2012-10-19 Thread Daπid
On Fri, Oct 19, 2012 at 11:08 PM, elmar werling el...@net4werling.de wrote: vmin=min(z), vmax=max(z) A suggestion, when dealing with arrays, it is generally faster to use the numpy function to compute the max and min, either np.max(z) or z.max(), than the standard Python one.

Re: [Matplotlib-users] mpl command-line utilities

2012-10-17 Thread Daπid
I also think that would be useful. It would, for example, allow to generate preview plots from other languages, without interfacing them to Python. It must be said that MPL is actually quite nice looking in the default settings for basic plotting, and this is an nice feature that can exploit. I

Re: [Matplotlib-users] installating matplotlib in mac 10.7.4 for python 2.6

2012-10-13 Thread Daπid
On Sun, Oct 14, 2012 at 3:42 AM, Paul Tremblay paulhtremb...@gmail.com wrote: You don't want to install for python 2.6. Python 2.6 is out of date at this point. I disagree. Most of the tools and libraries for 2.6 are available for 2.7 and viceversa (they are quite similar), but not all of them.

Re: [Matplotlib-users] installating matplotlib in mac 10.7.4 for python 2.6

2012-10-13 Thread Daπid
in the terminal type: sudo port install py26-python sudo port install py26-matplotlib and there you are! On Sun, Oct 14, 2012 at 5:37 AM, lulu lauracur...@me.com wrote: Okay -- that's good to know. I've just installed macports, but am not sure how to go about using matplotlib in my python

Re: [Matplotlib-users] Corrupted percent signs in labels

2012-10-09 Thread Daπid
On Windows it works just fine. Just a wild guess, can you try to make it a raw string? plt.xlabel(r'Percent [%]') On Tue, Oct 9, 2012 at 10:45 PM, Francesco Montesano franz.berges...@gmail.com wrote: Hi 2012/10/9 Nikolaus Rath nikol...@rath.org Hello, For some reason, my matplotlib isn't

Re: [Matplotlib-users] python question from matlab user

2012-09-11 Thread Daπid
On Sunday, September 9, 2012, Eric Firing wrote: Regarding the need to pre-allocate: yes, matlab is slicker in this regard, and every now and then there is discussion about implementing equivalent behavior in numpy, or in an add-on module. Technically, you don´t have to preallocate the

Re: [Matplotlib-users] ValueError: x and y must have same first dimension

2012-07-27 Thread Daπid
In the example you provide, bins is returned by the hist command, whereas in your code, bins is a number that you defined as 20. So, change: bins = 20 plt.hist(C, bins, ... by: nbins = 20 n, bins, patches = plt.hist(C, nbins, ... As a side comment, your data loading is too complex, and fail

Re: [Matplotlib-users] ValueError: x and y must have same first dimension

2012-07-27 Thread Daπid
On Fri, Jul 27, 2012 at 9:57 PM, surfcast23 surfcas...@gmail.com wrote: y = mlab.normpdf( nbins, avg, sigma) l = plt.plot(nbins, y, 'r--', linewidth=1) plt.show() You should not change bins there, as you are evaluating the gaussian function at different values. Also, sigma is a vector, but it

Re: [Matplotlib-users] ValueError: x and y must have same first dimension

2012-07-27 Thread Daπid
, surfcast23 surfcas...@gmail.com wrote: Thanks for catching that sigma was still a vector! I am no longer getting the errors, but the best fit line is not showing up.Is there something else I am missing ? BTW thanks for the heads up on the np.mean and np.standard functions. Khary Daπid

Re: [Matplotlib-users] ValueError: x and y must have same first dimension

2012-07-27 Thread Daπid
On Sat, Jul 28, 2012 at 12:22 AM, surfcast23 surfcas...@gmail.com wrote: Am I reading (bins[1]-bins[0]) correctly as taking the difference between what is in the second and first bin? Yes. I am multipliying the width of the bins by their total height. Surely there are cleaner and more general

Re: [Matplotlib-users] How to plot only a legend?

2012-07-26 Thread Daπid
On Thu, Jul 26, 2012 at 5:05 PM, Andreas Hilboll li...@hilboll.de wrote: That's really easy :) I could live with this solution, applying some external tool like pdfcrop to the result. If you can use other output, you can generate a png image, which would be easier to cut (even inside

Re: [Matplotlib-users] Additional line styles - comparison excel chart

2012-07-16 Thread Daπid
On Mon, Jul 16, 2012 at 11:09 AM, Benjamin Jonen bjo...@gmail.com wrote: 2) The coloring and the way the lines curve around looks very nice to me. I remember that the Excel charts did not have this nice look before Excel 2007. Can I achieve similar effects with matplotlib? I'm not really sure

Re: [Matplotlib-users] histogram scaling

2012-07-12 Thread Daπid
I don't know if there is any reason for not having it, but as a workaround, you could use np.hist to get the data (syntax is the same as mpl.hist and returns the same numbers, but without drawing) and then renormalise and plot with mpl.bars. On Thu, Jul 12, 2012 at 4:42 PM, Alan G Isaac

[Matplotlib-users] Typing \H{o} in LaTeX

2012-06-18 Thread Daπid
Hello, I am trying to type Erdős in the title of a figure. I am using the LaTeX command Erd\H{o}s, as it works in normal latex documents both in text and math mode, but it malfunctioning putting the two lines on the d. To obtain the proper typeset, I have to write: plt.title(r$Erdo\H s$) This

Re: [Matplotlib-users] logairthmic contour plot

2012-06-14 Thread Daπid
If all your values are positive (and you are sure of it), you could use the SymmetricalLogScale It uses log scale for large values (both positive and negative), and linear for small ones. http://matplotlib.sourceforge.net/devel/add_new_projection.html I believe there is a way to do it without

Re: [Matplotlib-users] logairthmic contour plot

2012-06-14 Thread Daπid
First, this is another topic, so please, change the subject of the message so it doesn't get messed up with others (and possible help lost in the process). Now, you are indeed plotting one dot at the time and generating a label for it. If you don't want that, you have to plot the whole list at

[Matplotlib-users] Gallery broken link

2012-01-25 Thread Daπid
http://matplotlib.sourceforge.net/examples/api/demo_affine_image_00.html This link of the gallery example is broken (error 404). It corresponds to the third example of the fourth row. -- Keep Your Developer Skills

Re: [Matplotlib-users] Memory increasing while plotting in loop

2011-06-16 Thread Daπid
I can run the script you provided up to 600 without noticing any memory growth (TkAgg backend by default). Using the WxAgg, the memory leak appears. If you don't explicitly need WxAgg, I would recommend using TkAgg, or better Agg if you are not showing the figures. If it is not the case, more

Re: [Matplotlib-users] Memory increasing while plotting in loop

2011-06-15 Thread Daπid
You are importing pylab again before each plot. You have loaded it before. for i,t in enumerate(times): import pylab as pl # --ERASE THIS On Wed, Jun 15, 2011 at 12:10 PM, Alain Pascal Frances frances17...@itc.nl wrote: Hi, I have a script that creates and saves figures in a loop.

Re: [Matplotlib-users] Plotting in loop problem, not refreshing

2011-06-05 Thread Daπid
I am using MPL 1.0.1 with Python 2.6 over Windows XP and it works. I would like to add an advice: range(n) creates a list of size n, and stores it in memory. But in your code you are only using one number at a time. Python has a better instruction: xrange. It works exactly like range, but doesn't

Re: [Matplotlib-users] strange behavior with imshow

2011-04-18 Thread Daπid
I have checked with all the interpolation modes and the only one that behaves badly is 'nearest'. There are them: http://dl.dropbox.com/u/1351211/Interpolation_modes.zip On Mon, Apr 18, 2011 at 12:46 PM, Emanuele Passera emanuele.pass...@treuropa.com wrote: Hello everybody, I am experiencing a

[Matplotlib-users] Pyplot interactive mode. Issue or misuse?

2011-04-03 Thread Daπid
Hello. I want to plot the result of a calculation, show it, modify and repeat. I have tried with pyplot interactive mode, see code: http://pastebin.com/jsdsLN4z The first plot shows fine, but from now on, all the new plots appear in a new window and all of them are blank --including the first

[Matplotlib-users] show(), the state of the art

2010-11-02 Thread Daπid
Hello. It is stated that show() should be the last function in a script, as long as it will stop the execution of the program. Nevertheless, I have seen that the current behavior is just a pause in the flow, and it will be restored when the window is closed. The documentation says: Many users

Re: [Matplotlib-users] show(), the state of the art

2010-11-02 Thread Daπid
On Tue, Nov 2, 2010 at 12:49 PM, David Kremer david.kremer...@gmail.com wrote: Personally I used show() yesterday, and it blocks the execution until the figure's window is closed. It is of perfect convenience I think, as a default behavior. Yes, this is the optimal behavior, but it is not

Re: [Matplotlib-users] Equation

2010-10-14 Thread Daπid
If you are curious, here is what Mathematica can tell about the integral (assuming everything constant but z): http://pastebin.com/Gir3XZBe On Wed, Oct 13, 2010 at 4:28 PM, Waléria Antunes David waleriantu...@gmail.com wrote: Hi all, I know here is a group for matplotlib, but can anyone

Re: [Matplotlib-users] Basemap: High resolution output cutout marks on contours

2010-10-04 Thread Daπid
On Mon, Oct 4, 2010 at 11:36 AM, nickj nickja...@gmail.com wrote: To better illustrate my problem, here is a screenshot with added red lines pointing to the odd slicing I get around the contours: http://www.bigoceans.com/slices.png A low-tech option is to plot first all the oceans in light

Re: [Matplotlib-users] WebP support

2010-10-02 Thread Daπid
On Sat, Oct 2, 2010 at 7:39 PM, Jouni K. Seppänen j...@iki.fi wrote: And yet, we still allow for saving to jpegs. Wow, I didn't know. Last time I tried that I got a traceback, and assumed that it was not supported exactly because jpeg is a nonsensical format for most graphs. Don't forget MPL

Re: [Matplotlib-users] Z channel

2010-09-16 Thread Daπid
today. ;-) On Thu, Sep 16, 2010 at 5:12 PM, Benjamin Root ben.r...@ou.edu wrote: On Thu, Sep 16, 2010 at 12:03 AM, Daπid davidmen...@gmail.com wrote: Does MPL support in any way the Z channel? If not, is there any possibility to use it? For example, to create a parallel matrix of the same

Re: [Matplotlib-users] Level surface of a function of 3 variables

2010-09-15 Thread Daπid
I think you can make it with pyplot.contourf() and the argument V http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.contour contour(Z,V) contour(X,Y,Z,V) draw contour lines at the values specified in sequence V On Wed, Sep 15, 2010 at 9:02 PM, Luke hazelnu...@gmail.com

[Matplotlib-users] Z channel

2010-09-15 Thread Daπid
Does MPL support in any way the Z channel? If not, is there any possibility to use it? For example, to create a parallel matrix of the same dimensions of the image with the values of Z in each pixel. Thank you very much. David.

Re: [Matplotlib-users] Reduce image size

2010-08-30 Thread Daπid
If it is only one image, an easy low-tech workaround is to save it as PNG and then put it into a PDF. This way, you only have to load one element. On Mon, Aug 30, 2010 at 11:36 PM, Jeremy Conlin jlcon...@gmail.com wrote: I have a matplotlib plot that I saved to a pdf image.  The plot consists

Re: [Matplotlib-users] CMYK images

2010-08-26 Thread Daπid
Image Magick and Inkscape seem to work for this. Probably the first one is easier to automatize in batch processing. On Thu, Aug 26, 2010 at 4:21 PM, Michael Droettboom md...@stsci.edu wrote: matplotlib does not have any built-in support for any color spaces other than RGB.  You would need to

Re: [Matplotlib-users] saving animations

2010-08-25 Thread Daπid
I cannot see what is wrong, but after saving each figure you should add plt.clf() in order to delete the image and preventing memory leaks, because MPL stores one image in top of the other. For the filecode I suggest you to use something like: savefig(head+str(filecode).zfill(digits)+format,

Re: [Matplotlib-users] Animated artists not present in savefigged files

2010-08-23 Thread Daπid
What I use to create animations is plainly: savefig(head+str(filecode).zfill(digits)+format, dpi=205) plt.clf() filecode+=1 where filecode is the name, digits an int and format usually .png. clf() is important in order to prevent memory leaks, because otherwise mpl stores all the figures one in

Re: [Matplotlib-users] Issue with hist plotting

2010-08-22 Thread Daπid
On Sat, Aug 14, 2010 at 10:19 PM, Eric Firing efir...@hawaii.edu wrote: The problem is that the alpha kwarg can never be other than a scalar in mpl at present, as far as I know.  The error message from to_rgba was intended to be informative, but in this case it is misleading. Thanks for your

[Matplotlib-users] Issue with hist plotting

2010-08-14 Thread Daπid
Hello. I have had an issue trying to plot an histogram with Matplotlib. The line is: plt.hist([SNIa.angles, SNIbc.angles, SNII.angles], 11, range=[-pi, pi], normed=True,histtype='stepfilled',color=['g', 'r', 'b'],alpha=[1, 0.6, 1]) But the error is raised when I try to save the image.