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) 

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) 
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) 
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) 
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) 
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) 
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) 
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) 
2012 
_{Jan}
(322) 
_{Feb}
(414) 
_{Mar}
(377) 
_{Apr}
(179) 
_{May}
(173) 
_{Jun}
(234) 
_{Jul}
(151) 
_{Aug}

_{Sep}

_{Oct}

_{Nov}

_{Dec}

S  M  T  W  T  F  S 







1
(11) 
2
(24) 
3
(24) 
4
(31) 
5
(30) 
6
(27) 
7
(25) 
8
(8) 
9
(2) 
10
(12) 
11
(16) 
12
(33) 
13
(18) 
14
(17) 
15
(3) 
16
(7) 
17
(8) 
18
(22) 
19
(20) 
20
(25) 
21
(10) 
22
(17) 
23
(18) 
24
(23) 
25
(15) 
26
(19) 
27
(6) 
28
(7) 
29
(6) 
30
(1) 
31
(12) 





From: Alan G Isaac <alan.isaac@gm...>  20090808 18:53:23

On 8/8/2009 10:09 AM John Hunter apparently wrote: > Here is the corrected example: Seems perfect! Time to study it. Thanks! Alan 
From: Gael Varoquaux <gael.varoquaux@no...>  20090808 16:13:19

On Thu, Aug 06, 2009 at 10:53:13AM 0400, JaeJoon Lee wrote: > The thread below might be helpful. > http://thread.gmane.org/gmane.comp.python.matplotlib.general/16373 > This will work as far as you keep the aspect="auto". > Also, if you're using matplotlib 0.99rc version, or matplotlib from > svn, you may take a look at > http://matplotlib.sourceforge.net/mpl_toolkits/axes_grid/users/overview.html#insetlocator > This works even though aspect=1 (or other value). Thanks a lot to both of you. I have fallen in a time gap, and thus have had to switch to other work and haven't been able to use your advice, but it will come in handy when I get back to what I was doing. Gaël 
From: John Hunter <jdh2358@gm...>  20090808 14:09:41

On Sat, Aug 8, 2009 at 9:00 AM, John Hunter<jdh2358@...> wrote: > """ > This example shows how to use a path patch to draw a bunch of > rectangles for an animated histogram > """ Oops, in my last post I have the timer logic wrong because the call is nonblocking so the animation ran too fast  a rare occurrence in the world of mpl animation :) Here is the corrected example: """ This example shows how to use a path patch to draw a bunch of rectangles for an animated histogram """ import time import numpy as np import matplotlib matplotlib.use('TkAgg') # do this before importing pylab import matplotlib.pyplot as plt import matplotlib.patches as patches import matplotlib.path as path fig = plt.figure() ax = fig.add_subplot(111) # histogram our data with numpy data = np.random.randn(1000) n, bins = np.histogram(data, 100) # get the corners of the rectangles for the histogram left = np.array(bins[:1]) right = np.array(bins[1:]) bottom = np.zeros(len(left)) top = bottom + n nrects = len(left) # here comes the tricky part  we have to set up the vertex and path # codes arrays using moveto, lineto and closepoly # for each rect: 1 for the MOVETO, 3 for the LINETO, 1 for the # CLOSEPOLY; the vert for the closepoly is ignored but we still need # it to keep the codes aligned with the vertices nverts = nrects*(1+3+1) verts = np.zeros((nverts, 2)) codes = np.ones(nverts, int) * path.Path.LINETO codes[0::5] = path.Path.MOVETO codes[4::5] = path.Path.CLOSEPOLY verts[0::5,0] = left verts[0::5,1] = bottom verts[1::5,0] = left verts[1::5,1] = top verts[2::5,0] = right verts[2::5,1] = top verts[3::5,0] = right verts[3::5,1] = bottom barpath = path.Path(verts, codes) patch = patches.PathPatch(barpath, facecolor='green', edgecolor='yellow', alpha=0.5) ax.add_patch(patch) ax.set_xlim(left[0], right[1]) ax.set_ylim(bottom.min(), top.max()) def animate(): if animate.cnt>=100: return animate.cnt += 1 # simulate new data coming in data = np.random.randn(1000) n, bins = np.histogram(data, 100) top = bottom + n verts[1::5,1] = top verts[2::5,1] = top fig.canvas.draw() fig.canvas.manager.window.after(100, animate) animate.cnt = 0 fig.canvas.manager.window.after(100, animate) plt.show() 
From: John Hunter <jdh2358@gm...>  20090808 14:00:28

On Sat, Aug 8, 2009 at 6:17 AM, Kaushik Ghose<Kaushik_Ghose@...> wrote: > (http://matplotlib.sourceforge.net/api/artist_api.html#matplotlib.patches.Rectangle) > e.g. set_height() to change the rectangles? > > e.g. code >  > import pylab > x = pylab.rand(20) > h = pylab.hist(x) > h[2][0].set_height(1) > pylab.draw() >  This is the right idea, but it is likely to be slow for animation, since each rectangle is a separate mpl object, each with its own graphics contexs, rendering step, etc. bar and hist were very early functions which I wrote before we had collections and compound paths. If I were rewriting it from scratch, I would use a compound path. It's a little more work upfront because you have to manually compute the vertices and path codes, but it will be googobs faster. Here is the animated histogram for tk using compound paths """ This example shows how to use a path patch to draw a bunch of rectangles for an animated histogram """ import numpy as np import matplotlib matplotlib.use('TkAgg') # do this before importing pylab import matplotlib.pyplot as plt import matplotlib.patches as patches import matplotlib.path as path fig = plt.figure() ax = fig.add_subplot(111) # histogram our data with numpy data = np.random.randn(1000) n, bins = np.histogram(data, 100) # get the corners of the rectangles for the histogram left = np.array(bins[:1]) right = np.array(bins[1:]) bottom = np.zeros(len(left)) top = bottom + n nrects = len(left) # here comes the tricky part  we have to set up the vertex and path # codes arrays using moveto, lineto and closepoly # for each rect: 1 for the MOVETO, 3 for the LINETO, 1 for the # CLOSEPOLY; the vert for the closepoly is ignored but we still need # it to keep the codes aligned with the vertices nverts = nrects*(1+3+1) verts = np.zeros((nverts, 2)) codes = np.ones(nverts, int) * path.Path.LINETO codes[0::5] = path.Path.MOVETO codes[4::5] = path.Path.CLOSEPOLY verts[0::5,0] = left verts[0::5,1] = bottom verts[1::5,0] = left verts[1::5,1] = top verts[2::5,0] = right verts[2::5,1] = top verts[3::5,0] = right verts[3::5,1] = bottom barpath = path.Path(verts, codes) patch = patches.PathPatch(barpath, facecolor='green', edgecolor='yellow', alpha=0.5) ax.add_patch(patch) ax.set_xlim(left[0], right[1]) ax.set_ylim(bottom.min(), top.max()) def animate(): # simulate new data coming in data = np.random.randn(1000) n, bins = np.histogram(data, 100) top = bottom + n verts[1::5,1] = top verts[2::5,1] = top fig.canvas.draw() def run(): for i in range(100): fig.canvas.manager.window.after(100, animate) fig.canvas.manager.window.after(100, run) plt.show() 
From: JaeJoon Lee <lee.j.joon@gm...>  20090808 11:31:28

The guide is based on mpl 0.99. You may upgrade your mpl, or take a look at the thread below. it is a workaround that will work with older version. JJ On Fri, Aug 7, 2009 at 8:29 PM, Eliezer, David<deliezer@...> wrote: > Hi, > I am graphing several time series together on the same graph, > and so it is important to have a legend. I am also stacking two graphs > on top of one another, because some of the data is of a different type. > > I wrote the graphing code as follows (pardon the newbie code, this is my > first matplotlib day…) > > fig = plt.figure() > axU = fig.add_subplot(211) > axU.set_ylabel('price,$', color='r') > axU.grid(True) > axL = fig.add_subplot(212) > axL.set_ylabel('size, shs', color='b') > axL.grid(True) > stepPlotsU = [] > stepPlotsL = [] > for i in range( len( plotvalues ) ) : > if axisSide[i] == 'U' : > stepPlotsU.append(axU.step( T,plotvalues[i], where='post' )) > else : > stepPlotsL.append(axL.step( T,plotvalues[i], where='post' )) > > lU = axU.legend(tuple(stepPlotsU),tuple(legendArrayU),loc='upper right') > lL = axL.legend( tuple(stepPlotsL),tuple(legendArrayL),loc='upper right') > axU.axis([float(TMin),float(TMax),1.1 * minValueU 0.1 * > maxValueU,1.1*maxValueU  0.1*minValueU]) > axL.axis([float(TMin),float(TMax),0.8*minValueL,1.2*maxValueL]) > axU.set_xlabel("Time, secs") > fig.savefig('test.png') > > My code works, and produces an almost perfect graph, BUT… > My problem is that the legend is quite large, and covers up a lot of the > graph. > The solution seems to be in the user guide, here > > <http://matplotlib.sourceforge.net/users/plotting/legend.html#plottingguidelegend>; > > where it shows how to call legend with the kwarg bbox_to_anchor=(1.05,1), > and in the > example, the box is nicely moved. > > In my case, though, I am calling > > axU.legend(tuple(stepPlotsU),tuple(legendArrayU),loc='upper right', > bbox_to_anchor=(1.05,1)) > > but it says this is an “unexpected keyword)”, I assume it is saying that > axis.legend() doesn’t use this > keyword, even if legend does. > > lL = axL.legend( tuple(stepPlotsL),tuple(legendArrayL),loc='upper > right',bbox_to_anchor=(1.05,1)) > File > "/etg/source/Linux/pkg/Python2.6.2/lib/python2.6/sitepackages/matplotlib/axes.py", > line 3823, in legend > self.legend_ = mlegend.Legend(self, handles, labels, **kwargs) > TypeError: __init__() got an unexpected keyword argument 'bbox_to_anchor' > > Does anyone out there know what I can do to get the legend off my graph? > And is there a way > to shrink the legend font size down? It is way too large, and I can’t find > anything in the docs about this, > that axis.legend() will accept… > > Dave > > PS: I am using Python 2.6.2, matplotlib 0.98.5.3, numpy 1.3.0, scipy 0.7.1 > > > > DISCLAIMER: > This email, and any attachments thereto, is intended only for use by the > addressee(s) named herein and may contain legally privileged and/or > confidential information. If you are not the intended recipient of this > email, you are hereby notified that any dissemination, distribution or > copying of this email, and any attachments thereto, is strictly prohibited. > If you have received this in error, please immediately notify me and > permanently delete the original and any copy of any email and any printout > thereof. Email transmission cannot be guaranteed to be secure or > errorfree. The sender therefore does not accept liability for any errors or > omissions in the contents of this message which arise as a result of email > transmission. > NOTICE REGARDING PRIVACY AND CONFIDENTIALITY Knight Capital Group may, at > its discretion, monitor and review the content of all email communications. > http://www.knight.com > > >  > Let Crystal Reports handle the reporting  Free Crystal Reports 2008 30Day > trial. Simplify your report design, integration and deployment  and focus > on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobjjuly > _______________________________________________ > Matplotlibusers mailing list > Matplotlibusers@... > https://lists.sourceforge.net/lists/listinfo/matplotlibusers > > 
From: Kaushik Ghose <Kaushik_Ghose@hm...>  20090808 11:17:19

Hi Alan, Alan G Isaac wrote: > This is a second plea for help. > http://www.mailarchive.com/matplotlibusers@.../msg12632.html > > I have a figure.Figure embedded in a FigureCanvasTkAgg. > Each iteration, new data are received, > and I want an updated histogram. > > Now I can at least see a way to do this with pyplot: > I just clear my axes each iteration, call ax.hist, > and then call plot.draw(). I think (?) my problem > is finding an equivalent to plt.draw() in the object > oriented interface. > > What I'd really like to do each iteration is change > only the heights of the rectangles. > I don't do fancy stuff like embedding figures in GUIs, but assuming things work the same way regardless: have you tried grabbing the object handles from hist (which are patches) and using the rectangle patch functions (http://matplotlib.sourceforge.net/api/artist_api.html#matplotlib.patches.Rectangle) e.g. set_height() to change the rectangles? e.g. code  import pylab x = pylab.rand(20) h = pylab.hist(x) h[2][0].set_height(1) pylab.draw()  h is a tuple with the last element as a list of patch objects In [82]: h Out[82]: (array([3, 3, 2, 1, 3, 0, 0, 1, 3, 4]), array([ 0.02262869, 0.11966418, 0.21669968, 0.31373517, 0.41077066, 0.50780615, 0.60484164, 0.70187713, 0.79891263, 0.89594812, 0.99298361]), <a list of 10 Patch objects>) Best Kaushik 
From: Eric Firing <efiring@ha...>  20090808 02:19:06

Zane Selvans wrote: > Hey there, > > I'm trying to plot a bunchovectors, colored red or blue, depending on > whether their magnitude is positive or negative (they represent > stresses), and I'm doing something like this: > > mag1 = evals[:,0] > ex1 = evecs[:,0,1] > ey1 = evecs[:,0,0] > C1 = np.where(mag1 >= 0, 'red', 'blue') > > mag2 = evals[:,1] > ex2 = evecs[:,1,1] > ey2 = evecs[:,1,0] > C2 = np.where(mag2 >= 0, 'red', 'blue') > The C argument to quiver is for an array to be used with a colormap; you could use that with a listed colormap, or, to use something very close to what you already have, try using the "color" kwarg for your C1 and C2. It takes a single value or a sequence of color specs. Eric > basemap_ax.quiver(np.degrees(calc_phis), > np.degrees(np.pi/2.0calc_thetas), mag1*ex1, mag1*ey1, C1, lw=0, > width=0.002, scale=1e8) > basemap_ax.quiver(np.degrees(calc_phis), > np.degrees(np.pi/2.0calc_thetas), mag2*ex2, mag2*ey2, C2, lw=0, > width=0.002, scale=1e8) > basemap_ax.quiver(np.degrees(calc_phis), > np.degrees(np.pi/2.0calc_thetas), mag1*ex1, mag1*ey1, C1, lw=0, > width=0.002, scale=1e8) > basemap_ax.quiver(np.degrees(calc_phis), > np.degrees(np.pi/2.0calc_thetas), mag2*ex2, mag2*ey2, C2, lw=0, > width=0.002, scale=1e8) > > And it gives me the stack trace below... I also tried just using > plainold quiver (not via basemap) and got the same error. I tried > using rgba tuples and grayscale strings as colors as well, and still got > the same error. Anybody have any idea what the deal is? Or am I > misunderstanding what *C* is supposed to be (i.e. not just an array of > colors, of the same length as the number of vectors being plotted...) > > /Library/Python/2.5/sitepackages/mpl_toolkits/basemap/__init__.pyc in > quiver(self, x, y, u, v, *args, **kwargs) > 2877 ax.hold(h) > 2878 try: > > 2879 ret = ax.quiver(x,y,u,v,*args,**kwargs) > 2880 try: > 2881 plt.draw_if_interactive() > > /Library/Python/2.5/sitepackages/matplotlib/axes.pyc in quiver(self, > *args, **kw) > 5850 def quiver(self, *args, **kw): > 5851 if not self._hold: self.cla() > > 5852 q = mquiver.Quiver(self, *args, **kw) > 5853 self.add_collection(q, False) > 5854 self.update_datalim(q.XY) > > /Library/Python/2.5/sitepackages/matplotlib/quiver.pyc in > __init__(self, ax, *args, **kw) > 367 **kw) > 368 self.polykw = kw > > 369 self.set_UVC(U, V, C) > 370 self._initialized = False > 371 > > /Library/Python/2.5/sitepackages/matplotlib/quiver.pyc in set_UVC(self, > U, V, C) > 439 mask = ma.mask_or(U.mask, V.mask, copy=False, shrink=True) > 440 if C is not None: > > 441 C = ma.masked_invalid(C, copy=False).ravel() > 442 mask = ma.mask_or(mask, C.mask, copy=False, shrink=True) > 443 if mask is ma.nomask: > > /Library/Python/2.5/sitepackages/numpy/ma/core.pyc in masked_invalid(a, > copy) > 1996 """ > 1997 a = np.array(a, copy=copy, subok=True) > > 1998 condition = ~(np.isfinite(a)) > 1999 if hasattr(a, '_mask'): > 2000 condition = mask_or(condition, a._mask) > > TypeError: bad operand type for unary ~: 'NotImplementedType' > > >  > Zane A. Selvans > Amateur Earthling > http://zaneselvans.org > +1 303 815 6866 > > >  > >  > Let Crystal Reports handle the reporting  Free Crystal Reports 2008 30Day > trial. Simplify your report design, integration and deployment  and focus on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobjjuly > > >  > > _______________________________________________ > Matplotlibusers mailing list > Matplotlibusers@... > https://lists.sourceforge.net/lists/listinfo/matplotlibusers 
From: Eliezer, David <deliezer@kn...>  20090808 00:44:51

Hi, I am graphing several time series together on the same graph, and so it is important to have a legend. I am also stacking two graphs on top of one another, because some of the data is of a different type. I wrote the graphing code as follows (pardon the newbie code, this is my first matplotlib day...) fig = plt.figure() axU = fig.add_subplot(211) axU.set_ylabel('price,$', color='r') axU.grid(True) axL = fig.add_subplot(212) axL.set_ylabel('size, shs', color='b') axL.grid(True) stepPlotsU = [] stepPlotsL = [] for i in range( len( plotvalues ) ) : if axisSide[i] == 'U' : stepPlotsU.append(axU.step( T,plotvalues[i], where='post' )) else : stepPlotsL.append(axL.step( T,plotvalues[i], where='post' )) lU = axU.legend(tuple(stepPlotsU),tuple(legendArrayU),loc='upper right') lL = axL.legend( tuple(stepPlotsL),tuple(legendArrayL),loc='upper right') axU.axis([float(TMin),float(TMax),1.1 * minValueU 0.1 * maxValueU,1.1*maxValueU  0.1*minValueU]) axL.axis([float(TMin),float(TMax),0.8*minValueL,1.2*maxValueL]) axU.set_xlabel("Time, secs") fig.savefig('test.png') My code works, and produces an almost perfect graph, BUT... My problem is that the legend is quite large, and covers up a lot of the graph. The solution seems to be in the user guide, here <http://matplotlib.sourceforge.net/users/plotting/legend.html#plottingguidelegend>; where it shows how to call legend with the kwarg bbox_to_anchor=(1.05,1), and in the example, the box is nicely moved. In my case, though, I am calling axU.legend(tuple(stepPlotsU),tuple(legendArrayU),loc='upper right', bbox_to_anchor=(1.05,1)) but it says this is an "unexpected keyword)", I assume it is saying that axis.legend() doesn't use this keyword, even if legend does. lL = axL.legend( tuple(stepPlotsL),tuple(legendArrayL),loc='upper right',bbox_to_anchor=(1.05,1)) File "/etg/source/Linux/pkg/Python2.6.2/lib/python2.6/sitepackages/matplotlib/axes.py", line 3823, in legend self.legend_ = mlegend.Legend(self, handles, labels, **kwargs) TypeError: __init__() got an unexpected keyword argument 'bbox_to_anchor' Does anyone out there know what I can do to get the legend off my graph? And is there a way to shrink the legend font size down? It is way too large, and I can't find anything in the docs about this, that axis.legend() will accept... Dave PS: I am using Python 2.6.2, matplotlib 0.98.5.3, numpy 1.3.0, scipy 0.7.1 DISCLAIMER: This email, and any attachments thereto, is intended only for use by the addressee(s) named herein and may contain legally privileged and/or confidential information. If you are not the intended recipient of this email, you are hereby notified that any dissemination, distribution or copying of this email, and any attachments thereto, is strictly prohibited. If you have received this in error, please immediately notify me and permanently delete the original and any copy of any email and any printout thereof. Email transmission cannot be guaranteed to be secure or errorfree. The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of email transmission. NOTICE REGARDING PRIVACY AND CONFIDENTIALITY Knight Capital Group may, at its discretion, monitor and review the content of all email communications. http://www.knight.com 