You can subscribe to this list here.
2003 
_{Jan}

_{Feb}

_{Mar}

_{Apr}

_{May}
(3) 
_{Jun}

_{Jul}

_{Aug}
(12) 
_{Sep}
(12) 
_{Oct}
(56) 
_{Nov}
(65) 
_{Dec}
(37) 

2005 
_{Jan}
(184) 
_{Feb}
(267) 
_{Mar}
(214) 
_{Apr}
(286) 
_{May}
(320) 
_{Jun}
(299) 
_{Jul}
(348) 
_{Aug}
(283) 
_{Sep}
(355) 
_{Oct}
(293) 
_{Nov}
(232) 
_{Dec}
(203) 
2008 
_{Jan}
(312) 
_{Feb}
(359) 
_{Mar}
(454) 
_{Apr}
(287) 
_{May}
(340) 
_{Jun}
(450) 
_{Jul}
(403) 
_{Aug}
(324) 
_{Sep}
(349) 
_{Oct}
(385) 
_{Nov}
(363) 
_{Dec}
(437) 
2009 
_{Jan}
(500) 
_{Feb}
(301) 
_{Mar}
(409) 
_{Apr}
(486) 
_{May}
(545) 
_{Jun}
(391) 
_{Jul}
(518) 
_{Aug}
(497) 
_{Sep}
(492) 
_{Oct}
(429) 
_{Nov}
(357) 
_{Dec}
(310) 
2011 
_{Jan}
(321) 
_{Feb}
(413) 
_{Mar}
(299) 
_{Apr}
(215) 
_{May}
(284) 
_{Jun}
(203) 
_{Jul}
(207) 
_{Aug}
(314) 
_{Sep}
(321) 
_{Oct}
(259) 
_{Nov}
(347) 
_{Dec}
(209) 
2006 
_{Jan}
(352) 
_{Feb}
(358) 
_{Mar}
(403) 
_{Apr}
(313) 
_{May}
(165) 
_{Jun}
(281) 
_{Jul}
(316) 
_{Aug}
(228) 
_{Sep}
(279) 
_{Oct}
(243) 
_{Nov}
(315) 
_{Dec}
(345) 
2010 
_{Jan}
(371) 
_{Feb}
(657) 
_{Mar}
(519) 
_{Apr}
(432) 
_{May}
(312) 
_{Jun}
(416) 
_{Jul}
(477) 
_{Aug}
(386) 
_{Sep}
(419) 
_{Oct}
(435) 
_{Nov}
(320) 
_{Dec}
(202) 
2004 
_{Jan}
(59) 
_{Feb}
(78) 
_{Mar}
(153) 
_{Apr}
(205) 
_{May}
(184) 
_{Jun}
(123) 
_{Jul}
(171) 
_{Aug}
(156) 
_{Sep}
(190) 
_{Oct}
(120) 
_{Nov}
(154) 
_{Dec}
(223) 
2012 
_{Jan}
(322) 
_{Feb}
(414) 
_{Mar}
(377) 
_{Apr}
(179) 
_{May}
(173) 
_{Jun}
(234) 
_{Jul}
(151) 
_{Aug}

_{Sep}

_{Oct}

_{Nov}

_{Dec}

2007 
_{Jan}
(260) 
_{Feb}
(323) 
_{Mar}
(340) 
_{Apr}
(319) 
_{May}
(290) 
_{Jun}
(296) 
_{Jul}
(221) 
_{Aug}
(292) 
_{Sep}
(242) 
_{Oct}
(248) 
_{Nov}
(242) 
_{Dec}
(332) 
S  M  T  W  T  F  S 




1
(12) 
2
(13) 
3
(14) 
4
(9) 
5
(9) 
6
(22) 
7
(17) 
8
(16) 
9
(19) 
10
(17) 
11
(6) 
12

13
(20) 
14
(21) 
15
(20) 
16
(10) 
17
(14) 
18
(3) 
19
(3) 
20
(12) 
21
(22) 
22
(26) 
23
(31) 
24
(26) 
25
(9) 
26
(4) 
27
(33) 
28
(15) 
29
(37) 
30
(26) 


From: VC <vascoch@gm...>  20090401 23:44:23

Hi all, I am experiencing the following difficulty: My program basically loops and wants to redraw a plot (using imshow() ) every 5 seconds or so. So it looks something like: ion() while 1: do redraw business.. time.sleep(5) The redrawing shows up fine, the only problem is that during the 5 seconds of sleep, I cannot really move the figure window or really do anything with it. I am using MPL on windows with the 'Qt4Agg' backed, and running this code from ipython (on the command line). I don't quite understand the threading model of the GUI kit, vs. the main thread, so could someone enlighten me how it works roughly, and what I need to do in a multithreaded application in order to update a figure periodically, and be able to move it around, and do things with its figure window. Thanks in advance for any responses. 
From: VGC123 <vascoch@gm...>  20090401 23:40:50

Hi all, I am experiencing the following difficulty: My program basically loops and wants to redraw a plot (using imshow() ) every 5 seconds or so. So it looks something like: ion() while 1: do redraw business.. time.sleep(5) The redrawing shows up fine, the only problem is that during the 5 seconds of sleep, I cannot really move the figure window or really do anything with it. I am using MPL on windows with the 'Qt4Agg' backed, and running this code from ipython (on the command line). I don't quite understand the threading model of the GUI kit, vs. the main thread, so could someone enlighten me how it works roughly, and what I need to do in a multithreaded application in order to update a figure periodically, and be able to move it around, and do things with its figure window. Thanks in advance for any responses.  View this message in context: http://www.nabble.com/Beingabletomovefigurearoundduringtime.sleep%28%29tp22835008p22835008.html Sent from the matplotlib  users mailing list archive at Nabble.com. 
From: Eric Firing <efiring@ha...>  20090401 21:53:08

Michael Hearne wrote: > Is it possible to use multiple conditionals with the pylab.find() function? > > For example, in Matlab, I can do the following: > > x = rand(1,10); > i = find(x > 0.5 & x < 0.9); %returns the indices between 0.5 and 0.9 > > In Python: (ipython pylab) > x = rand(1,10) > > None of the following approaches work: > #i = find(x > 0.5 and x < 0.9) > #i = find(x > 0.5 && x < 0.9) > #i = find(x > 0.5 & x < 0.9) > > I'm pretty certain there is some other way to do this using a numpy > method, and if that's all there is, then I will happily use it. > > However, if the goal of the pylab module is to achieve (some level of) > compatibility with Matlab, then may I suggest this sort of functionality > be added to the pylab.find() function? This is a fundamental python/numpy problem. The workaround is x = rand(10) i = find((x > 0.5) & (x < 0.9)) Note the explicit parentheses to make the conditionals evaluated before the bitwise and. The real problem is that we are stuck using bitwise and as a surrogate for logical and. This problem is not going away any time soon, although proposed solutions have been discussed. Also note that in numpy we are using a 1D array. If you really want the 2D array, then you will have to index it as x[:,i]. Longer term, the recommendation is that you move away from trying to write matlab code using pylab, and instead use numpy idioms directly. import numpy as np x = np.random.rand(10) y = x[(x > 0.5) & (x < 0.9)] or if you really want the indices: i = np.nonzero((x > 0.5) & (x < 0.9))[0] Eric > > Thanks, > > Mike > > >  > _______________________________________________ > Matplotlibusers mailing list > Matplotlibusers@... > https://lists.sourceforge.net/lists/listinfo/matplotlibusers 
From: Jeff Whitaker <jswhit@fa...>  20090401 21:50:45

Michael Hearne wrote: > Is it possible to use multiple conditionals with the pylab.find() function? > > For example, in Matlab, I can do the following: > > x = rand(1,10); > i = find(x > 0.5 & x < 0.9); %returns the indices between 0.5 and 0.9 > > In Python: (ipython pylab) > x = rand(1,10) > > None of the following approaches work: > #i = find(x > 0.5 and x < 0.9) > #i = find(x > 0.5 && x < 0.9) > #i = find(x > 0.5 & x < 0.9) > > I'm pretty certain there is some other way to do this using a numpy > method, and if that's all there is, then I will happily use it. > > However, if the goal of the pylab module is to achieve (some level of) > compatibility with Matlab, then may I suggest this sort of functionality > be added to the pylab.find() function? > > Thanks, > > Mike > Mike: Use numpy.logical_and/numpy.logical_or for elementwise logical operations. In your case, find(logical_and(x>0.5,x<0.9)) works, as does using parantheses find((x > 0.5) & (x < 0.9)) Jeff 
From: Michael Hearne <mhearne@us...>  20090401 21:29:38

Is it possible to use multiple conditionals with the pylab.find() function? For example, in Matlab, I can do the following: x = rand(1,10); i = find(x > 0.5 & x < 0.9); %returns the indices between 0.5 and 0.9 In Python: (ipython pylab) x = rand(1,10) None of the following approaches work: #i = find(x > 0.5 and x < 0.9) #i = find(x > 0.5 && x < 0.9) #i = find(x > 0.5 & x < 0.9) I'm pretty certain there is some other way to do this using a numpy method, and if that's all there is, then I will happily use it. However, if the goal of the pylab module is to achieve (some level of) compatibility with Matlab, then may I suggest this sort of functionality be added to the pylab.find() function? Thanks, Mike 
From: CohenTanugi Johann <cohen@lp...>  20090401 21:06:04

I tried to look at the code (axes.py I presume) in order to attempt a patch, but it defeated me, I do not have the instructions to navigate through this code :) Where is the actual transform of the error bars occurring? thanks, Johann Michael Droettboom wrote: > I have to say I don't really have a lot of experience with error bars > on log plots  but the root cause here is that the lower bound of the > error bar goes negative, and as we all know, the log of a negative > number is undefined. If you can suggest where the lower bound should > be drawn or provide thirdparty examples, I'm happy to look into this > further and resolve this "surprise". > > Mike > > CohenTanugi Johann wrote: >> yes exactly.... >> I should have provided a test case, thanks for following up! >> Johann >> >> Matthias Michler wrote: >> >>> Hello Johann, >>> >>> is the problem you are reporting the one I observe in the attached >>> picture? Namely some vertical and horizontal lines are missing when >>> using yscale="log". More precisely everything below y=1 seems to be >>> missing. >>> >>> The picture was generated with the code below and >>> matplotlib.__version__ = '0.98.6svn' >>> matplotlib.__revision__ = '$Revision: 6887 $' >>> >>> best regards Matthias >>> >>> ############################### >>> import numpy as np >>> import matplotlib.pyplot as plt >>> >>> plt.subplot(111, xscale="log", yscale="log") >>> x = 10.0**np.linspace(0.0, 2.0, 20) >>> y = x**2.0 >>> plt.errorbar(x, y, xerr=0.1*x, yerr=5.0+0.75*y) >>> plt.show() >>> ################################ >>> On Friday 27 March 2009 16:12:12 CohenTanugi Johann wrote: >>> >>>> Hello, what is the best way to get log log plots with error bars? I >>>> tried putting log10() everywhere but as I was afraid results look >>>> ugly.... >>>> thanks, >>>> johann >>>> >>>>  >>>> >>>> >>>>  >>>> >>>> >>>>  >>>> >>>> >>>>  >>>> >>>> >>>> _______________________________________________ >>>> Matplotlibusers mailing list >>>> Matplotlibusers@... >>>> https://lists.sourceforge.net/lists/listinfo/matplotlibusers >>>> >> >>  >> >> _______________________________________________ >> Matplotlibusers mailing list >> Matplotlibusers@... >> https://lists.sourceforge.net/lists/listinfo/matplotlibusers >> > 
From: John Hunter <jdh2358@gm...>  20090401 20:18:06

On Wed, Apr 1, 2009 at 2:50 PM, empty83 <matt.terry@...> wrote: > > I understand why things were not behaving as I expected and I don't really > have any good ideas on how to make a legend from a RegularPolyCollection in > general. > > However, I do not grok why fill_between returns a RegularPolyCollection > rather than a Polygon (like fill does). Does fill_between(x,y0,y1) differ > substantially from fill(x+x[::1], y0+y1[::1])? To me this seems like the > most intuitive behavior. Because fill_between handles masks, it uses a collection (a PolyCollection, not a RegularPolyCollection) rather than a simple Polygon. For example, see the use of the "where" argument in the second plot at http://matplotlib.sourceforge.net/examples/pylab_examples/fill_between.html The simplest way to handle this for the legend is probably to create a proxy Rectangle with the same properties as the first element in the poly collection. Since it is not designed to support multiple properties for the different fill regions, we might be able to improve this from a design and performance perspective by using a complex Path instead of a PolyCollection. In the interim, you can always manually create a legend using a proxy Rectangle passed in as a handle to the legend, though admittedly this is much more cumbersome. JDH 
From: empty83 <matt.terry@gm...>  20090401 19:50:31

I understand why things were not behaving as I expected and I don't really have any good ideas on how to make a legend from a RegularPolyCollection in general. However, I do not grok why fill_between returns a RegularPolyCollection rather than a Polygon (like fill does). Does fill_between(x,y0,y1) differ substantially from fill(x+x[::1], y0+y1[::1])? To me this seems like the most intuitive behavior. matt JaeJoon Lee wrote: > > The matplotlib legend does not currently support fill_between. As a > matter of fact, fill_between command creates RegularPolyCollection > artist, and the mpl legend does not know how to handle this kind of > artist at this time. And I personally do not have good idea how to > draw a handle for this (a simple rectangle box like the handles for > the Patch?). Any suggestion is welcomed. >  View this message in context: http://www.nabble.com/legendswithfill_betweentp22816609p22834285.html Sent from the matplotlib  users mailing list archive at Nabble.com. 
From: JaeJoon Lee <lee.joon@gm...>  20090401 17:54:50

This thread might be helpful. http://thread.gmane.org/gmane.comp.python.matplotlib.general/16373 Take a look at the above thread and see if it fits your need. However, it became tricky if your axes adjust its position (e.g., aspect=1) during the drawing time. The example below will be helpful in those case (you need recent version of matplotlib for this, see if your axes has "set_axes_locator" method), but this requires some knowledge on how mpl works. import matplotlib.transforms class InsetPosition(object): def __init__(self, parent, lbwh): self.parent = parent self.lbwh = lbwh # position of the inset axes in the normalized coordinate of the parent axes def __call__(self, ax, renderer): bbox_parent = self.parent.get_position(original=False) trans = matplotlib.transforms.BboxTransformTo(bbox_parent) bbox_inset = matplotlib.transforms.Bbox.from_bounds(*self.lbwh) bb = matplotlib.transforms.TransformedBbox(bbox_inset, trans) return bb ax = gca() ax.set_aspect(1.) axins = axes([0, 0, 1, 1]) ip = InsetPosition(ax, [0.5, 0.1, 0.4, 0.2]) axins.set_axes_locator(ip) IHTH, JJ On Wed, Apr 1, 2009 at 8:22 AM, oyarsa the old <oyarsa42@...> wrote: > Hello, > > I am new to matplotlib and pylab. > I have an image plotted with imshow/contour, or even just a coordinate > system plotted with axis. > > I need to plot smaller contours/images on them at selected pixels. The only > way I can figure how to do that is using axes. However, axes is defined on > normalised coordinates which cover the entire window, whereas the axis of > the main figure is drawn within it, with some margin. > > My problem is how to get the correct coordinates for plotting each of the > smaller figures ? The easiest way to do so would be to get the normalised > coordinates of the rectangle which is drawn by axis. Is there a way to get > that? > > Thanks > Mohan. > >  > > _______________________________________________ > Matplotlibusers mailing list > Matplotlibusers@... > https://lists.sourceforge.net/lists/listinfo/matplotlibusers > > 
From: JaeJoon Lee <lee.joon@gm...>  20090401 17:02:34

The matplotlib legend does not currently support fill_between. As a matter of fact, fill_between command creates RegularPolyCollection artist, and the mpl legend does not know how to handle this kind of artist at this time. And I personally do not have good idea how to draw a handle for this (a simple rectangle box like the handles for the Patch?). Any suggestion is welcomed. Meanwhile, you may draw an artist out of your axes area and use this for the legend entry. For example, for simple a rectangle handle, from pylab import fill_between, legend, show a = [0,1,2,4,5] b = [1,1,1,1,1] c = [0,1,2,4,5] fb = fill_between(a,b,c,label='hi') from matplotlib.patches import Rectangle r = Rectangle((0, 0), 1, 1) # creates rectangle patch for legend use. legend([r], ["hi"]) show() JJ On Tue, Mar 31, 2009 at 7:06 PM, empty83 <matt.terry@...> wrote: > > i can't make a legend for a fill_between and don't understand what i'm doing > wrong. the following code seems like the most obvious way to make a legend > for a fill_between, but does do what i expect. the code plots, but > complains that "No labeled objects found." any help would be much > appreciated. > > from pylab import fill_between, legend, show > a = [0,1,2,4,5] > b = [1,1,1,1,1] > c = [0,1,2,4,5] > fill_between(a,b,c,label='hi') > legend() > show() >  > View this message in context: http://www.nabble.com/legendswithfill_betweentp22816609p22816609.html > Sent from the matplotlib  users mailing list archive at Nabble.com. > > >  > _______________________________________________ > Matplotlibusers mailing list > Matplotlibusers@... > https://lists.sourceforge.net/lists/listinfo/matplotlibusers > 
From: oyarsa the old <oyarsa42@gm...>  20090401 13:11:34

Hello, I am new to matplotlib and pylab. I have an image plotted with imshow/contour, or even just a coordinate system plotted with axis. I need to plot smaller contours/images on them at selected pixels. The only way I can figure how to do that is using axes. However, axes is defined on normalised coordinates which cover the entire window, whereas the axis of the main figure is drawn within it, with some margin. My problem is how to get the correct coordinates for plotting each of the smaller figures ? The easiest way to do so would be to get the normalised coordinates of the rectangle which is drawn by axis. Is there a way to get that? Thanks Mohan. 
From: Lorenzo Isella <lorenzo.isella@gm...>  20090401 10:50:43

Dear All, I am having a hard time with something which must be fairly doable: I would like to plot a simple scalar function on a circular domain. Consider for instance a trivial modification of one of the online examples: Code 1 #!/usr/bin/env python """ See pcolor_demo2 for a much faster way of generating pcolor plots """ from __future__ import division from pylab import * def func3(x,y): return (1 x/2 + x**5 + y**3)*exp(x**2y**2) def func4(x,y): theta=arcsin(y) return cos(theta) # make these smaller to increase the resolution dx, dy = 0.05, 0.05 x = arange(1.0, 1.0, dx) y = arange(1.0, 1.0, dy) X,Y = meshgrid(x, y) Z = func4(X, Y) print "Z is, ", Z ax = subplot(111) im = imshow(Z, cmap=cm.jet) #im.set_interpolation('nearest') #im.set_interpolation('bicubic') im.set_interpolation('bilinear') #ax.set_image_extent(3, 3, 3, 3) show() Now, I would like to plot exactly the same function but on a circular domain (circle of radius 1 centered at (0,0)). What is the easiest way of doing that? Some time ago I came across a similar problem (again, plotting a scalar on a circular domain) and I came up with this code (thanks to the help I got from the list) Code 2 #! /usr/bin/env python from scipy import * import pylab import numpy nt=20 nr=20 r=linspace(0.,10.,nr) theta=linspace(0.,2.*pi,nt) #print "theta is ", theta sin_t=sin(theta) cos_t=cos(theta) rsin_t=r[newaxis,:]*sin_t[:,newaxis] rcos_t=r[newaxis,:]*cos_t[:,newaxis] rsin_t=ravel(rsin_t) rcos_t=ravel(rcos_t) rsin_t.shape=(nt,nr) rcos_t.shape=(nt,nr) vel_section=numpy.random.normal(0.,5.,(nr*nt)) vel_section=reshape(vel_section,(nt,nr)) print 'OK up to here' #pylab.colorbar() #pylab.clf() pylab.figure() X = rsin_t.transpose() Y = rcos_t.transpose() Z = vel_section.transpose() velmin = vel_section.min() velmax = vel_section.max() print velmin, velmax levels = arange(velmin, velmax+0.01, 0.1) pylab.contourf(X, Y, Z, levels, cmap=pylab.cm.jet) pylab.colorbar() pylab.show() pylab.savefig("velocity_on_section_DNS") #pylab.hold(False) but I have been unable to modify it according to my present needs. I am not really finding my way through the documentation/examples for some details (for instance, I am not sure about how to include a discrete colorbar ranging from 0 to 1 in steps of 0.1 in code 1), but at the moment this is secondary probably. Any suggestion is welcome. Many thanks Lorenzo  Life is what happens to you while you're busy making other plans. 