Re: [Matplotlib-users] saving images using pure matplotlib in Sage cuts off the bottom part (and produces corrupt file?)

2009-10-06 Thread jason-sage
Jae-Joon Lee wrote: > I think this has nothing to do with dpi, but a file flushing issue. > Try something like below with sage (note that the code does not work > with svn version of matplotlib, i'll commit the fix soon). > > import matplotlib > matplotlib.use('Agg') > import matplotlib.pyplot as p

Re: [Matplotlib-users] saving images using pure matplotlib in Sage cuts off the bottom part (and produces corrupt file?)

2009-10-05 Thread jason-sage
bytes). I consistently produced a zero-length file the first time I used the dpi keyword argument to savefig. If I called savefig again, the correct figure was saved to the file. Any ideas about what in the world could be going on here? The logs of my trials are below. Using Sage's c

Re: [Matplotlib-users] saving images using pure matplotlib in Sage cuts off the bottom part (and produces corrupt file?)

2009-10-05 Thread jason-sage
Jae-Joon Lee wrote: > As one of who never used Sage, I don't think I'll be any help here. > Anyhow, can you tell us what kind of backed is used by default in the > two environment? I mean the type of the canvas that is initially > created. > Thanks for following up on this. Is there an easy wa

[Matplotlib-users] saving images using pure matplotlib in Sage cuts off the bottom part (and produces corrupt file?)

2009-10-01 Thread jason-sage
Hi everyone, We're having a problem in Sage where if we specify the dpi of a figure, the bottom of the figure is cut off, but only the first time we save it. If we save the figure again, with the same arguments, the resulting image looks fine. I'm puzzled whether this is a Sage problem or a

Re: [Matplotlib-users] scaling arrows in quiver

2009-09-30 Thread jason-sage
Eric Firing wrote: > jason-s...@creativetrax.com wrote: >> A couple of us are trying to figure out how to scale arrows in a >> quiver plot so that we can exactly specify what the output arrows >> look like. For example, we'd like to scale the vectors to half of >> their size, and have it look l

[Matplotlib-users] scaling arrows in quiver

2009-09-29 Thread jason-sage
A couple of us are trying to figure out how to scale arrows in a quiver plot so that we can exactly specify what the output arrows look like. For example, we'd like to scale the vectors to half of their size, and have it look like that on the quiver plot. So I tried even just getting a quiver

Re: [Matplotlib-users] saving an axes to draw in a different figure

2009-09-18 Thread jason-sage
John Hunter wrote: > On Fri, Sep 18, 2009 at 11:44 AM, Jae-Joon Lee wrote: > >> I don't think your approach will work in general. >> When you move an axes from one figure to the other, you have to update >> the transform attributes of all the artists, which, I think, could be >> tricky to do fo

[Matplotlib-users] saving an axes to draw in a different figure

2009-09-17 Thread jason-sage
I'm trying to draw the axes from one figure directly over the axes for another figure, in a sense, combining the two axes as two layers on one figure. So, first I get an axes instance, "ax". import matplotlib.pyplot as plt fig=plt.figure() fig.add_subplot(111) plt.plot(range(10), [i^2 for i in

Re: [Matplotlib-users] incorrect boxplot?

2009-09-14 Thread jason-sage
Robert Kern wrote: > prctile does not handle the case where the exact percentile lies between two > items. scoreatpercentile does. > > If mlab is supposed to be compatible with matlab, then isn't this a problem? From matlab, version 7.2.0.283 (R2006a) >> prctile([1 1 2 2 1 2 4 3 2 2 2 3 4

[Matplotlib-users] incorrect boxplot?

2009-09-14 Thread jason-sage
I tried the following (most output text is deleted): In [1]: ob1=[1,1,2,2,1,2,4,3,2,2,2,3,4,5,6,7,8,9,7,6,4,5,5] In [2]: import matplotlib.pyplot as plt In [3]: plt.figure() In [4]: plt.boxplot(ob1)

Re: [Matplotlib-users] Can matplotlib generate charts like this?

2009-09-10 Thread jason-sage
Erik Wickstrom wrote: > Hi all, > > Can matplotlib (or any other Python charting library) generate charts > like this: (also attached if you prefer) > > http://imagebin.ca/view/iGhEQEE.html > > It's basically a moving average with the vertical lines being the > difference between the average and th

Re: [Matplotlib-users] clipping and linewidth/circle radius

2009-09-02 Thread jason-sage
Michael Droettboom wrote: > jason-s...@creativetrax.com wrote: >> I'm trying to deal nicely with the clipping that happens when, for >> example, a line has data that is inside its clipping box, but the >> linewidth forces part of the line to be drawn outside of the clipping >> box. This is visi

[Matplotlib-users] clipping and linewidth/circle radius

2009-09-01 Thread jason-sage
I'm trying to deal nicely with the clipping that happens when, for example, a line has data that is inside its clipping box, but the linewidth forces part of the line to be drawn outside of the clipping box. This is visible on the spine placement demo at http://matplotlib.sourceforge.net/exam

Re: [Matplotlib-users] setting axis label offset from end of spine

2009-09-01 Thread jason-sage
Michael Droettboom wrote: > Ah. I wasn't quite clear on what you were trying to do before. > > There's actually a bit of "magic" in there that automatically adjusts > the xlabel so it is lower than the xtick values. (If you rotate the > xtick values, you can see this in action). So it actually

[Matplotlib-users] setting axis label offset from end of spine

2009-08-29 Thread jason-sage
I'm trying to change the position of the axis label so that it is a certain number of points off the end of the spine representing the x-axis. I'm trying to use the transform attribute and the offset_copy function to say "put the label 5 points right of the end of the spine". So far, my code

Re: [Matplotlib-users] TikZ/PGF backend

2009-08-20 Thread jason-sage
Justin Findlay wrote: > I'm trying to find a way to embed matplotlib graphs in LaTeX > documents. Ideally a solution would involve converting MPL's output > to TikZ in order to get native rendering of the graphics and text. > This seems like the "Right Way" to go, unfortunately, my classes start >

Re: [Matplotlib-users] Align Text (Relative)

2009-08-14 Thread jason-sage
Andrew Kelly wrote: > I am currently using the annotate() method for my data points and I > was curious if there is a way to center a line of text relative to a > line of text below it. I am currently using two annotate() function > calls in a row (I need the text to be different colors) but I

[Matplotlib-users] spines versus subplotzero

2009-08-02 Thread jason-sage
I'm trying to understand some of the changes in 0.99, for example, the recommended way of getting a plot so that the axes cross at the origin (i.e., the axes are in the middle of the plot). I see two examples that seem to give this: http://matplotlib.sourceforge.net/examples/pylab_examples/spi

Re: [Matplotlib-users] Google summer of Code 2009

2009-03-09 Thread jason-sage
John Hunter wrote: > > > On Mon, Mar 9, 2009 at 3:41 PM, > wrote: > > Is matplotlib planning on applying to be a mentoring organization for > Google Summer of Code? If so, may I suggest that an html5/canvas > backend (with interactive features) woul

[Matplotlib-users] Google summer of Code 2009

2009-03-09 Thread jason-sage
Is matplotlib planning on applying to be a mentoring organization for Google Summer of Code? If so, may I suggest that an html5/canvas backend (with interactive features) would be a fantastic project that would benefit a wide range of people? Thanks, Jason --

Re: [Matplotlib-users] Venn diagrams

2009-02-16 Thread jason-sage
Ian Harry wrote: > Hi all, > > Is there any simple way in matplotlib, or in any other python library, to > make a simple Venn diagram, I want to show three events and their > intersections? I have tried googling for any hints but didn't find anything. > > You can use Sage (http://www.sagemath.o

Re: [Matplotlib-users] quiver and Inf values

2009-02-13 Thread jason-sage
Ryan May wrote: >> > Try changing your plot limits. :) > > pylab.xlim(-3,3) > pylab.ylim(-3,3) > Aha! Perfect; thank you! I'll fix this in Sage now... Jason -- Open Source Business Conference (OSBC), March 24-

Re: [Matplotlib-users] quiver and Inf values

2009-02-13 Thread jason-sage
Eric Firing wrote: > Ryan May wrote: >> On Fri, Feb 13, 2009 at 12:08 PM, > > wrote: >> >> >> A student of mine recently noticed that sometimes, quiver plots were >> coming up empty (using the plot_vector_field function from Sage, >> which >> passes

[Matplotlib-users] quiver and Inf values

2009-02-13 Thread jason-sage
A student of mine recently noticed that sometimes, quiver plots were coming up empty (using the plot_vector_field function from Sage, which passes everything on to quiver). Upon investigation, we saw that some of the array entries passed in were infinity because of where we happened to evalua

[Matplotlib-users] Safe SVN version

2009-01-23 Thread jason-sage
Hello all, I am at a Sage days workshop and one of my goals is to update matplotlib in Sage. We want to pull from SVN since there are some (very *nice*) arrow-drawing features only in SVN. Is there any recent commit points that we want to avoid because of stability? If not, we'll probably u

[Matplotlib-users] Axis lines crossing in them middle of the plot

2008-11-17 Thread jason-sage
There is some work going on in Sage (http://www.sagemath.org) to more fully use matplotlib on a higher level than is currently done. One issue that is coming up is using matplotlib to make a plot with axis lines crossing in the center of the plot, like is shown in the plot at http://sagemath.org/

Re: [Matplotlib-users] quiver aspect ratio

2008-09-19 Thread jason-sage
Eric Firing wrote: >>> Well, the easiest way is to build mpl from svn; a few minutes ago I >>> added this capability to quiver, selectable with an "angles" kwarg. Eric, I tried just copying the quiver.py SVN version 6114 into my existing matplotlib install and numpy 1.1.1. When running my exam

Re: [Matplotlib-users] quiver aspect ratio

2008-09-18 Thread jason-sage
Eric Firing wrote: > Jason, > >> >> In looking at the basemap examples (specifically quiver_demo.py), it >> looks like you specifically rotate the vectors to match up with map >> coordinates; is that right? Applying to the situation above, do I need > Yes. >> to rotate my vectors to respect the

Re: [Matplotlib-users] quiver aspect ratio

2008-09-18 Thread jason-sage
First off, in rereading my message, it sounded more abrasive than I intended. I should have asked more questions and complained less; sorry. Eric Firing wrote: > [EMAIL PROTECTED] wrote: > >> >> Is there an easy way to get a correct quiver plot (i.e., correct >> slopes) now if the aspect ratio i

[Matplotlib-users] quiver aspect ratio

2008-09-17 Thread jason-sage
Recently I noticed that the quiver plots all make the arrows as if the plot had aspect ratio 1. See, for example, the documentation for quiver: In all cases the arrow aspect ratio is 1, so that if *U*==*V* the angle of the arrow on the plot is 45 degrees CCW from the *x*-axis. This seems