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
(295) |
Aug
(239) |
Sep
(276) |
Oct
(355) |
Nov
(144) |
Dec
(108) |
2013 |
Jan
(170) |
Feb
(89) |
Mar
(204) |
Apr
(133) |
May
(142) |
Jun
(89) |
Jul
(160) |
Aug
(180) |
Sep
(69) |
Oct
(136) |
Nov
(83) |
Dec
(32) |
2014 |
Jan
(71) |
Feb
(90) |
Mar
(161) |
Apr
(117) |
May
(78) |
Jun
(94) |
Jul
(60) |
Aug
(83) |
Sep
(102) |
Oct
(132) |
Nov
(154) |
Dec
(96) |
2015 |
Jan
(45) |
Feb
(138) |
Mar
(176) |
Apr
(132) |
May
(119) |
Jun
(124) |
Jul
(77) |
Aug
(31) |
Sep
(34) |
Oct
(22) |
Nov
(23) |
Dec
(9) |
2016 |
Jan
(26) |
Feb
(17) |
Mar
(10) |
Apr
(8) |
May
(4) |
Jun
(8) |
Jul
(6) |
Aug
(5) |
Sep
(9) |
Oct
(4) |
Nov
|
Dec
|
2017 |
Jan
(5) |
Feb
(7) |
Mar
(1) |
Apr
(5) |
May
|
Jun
(3) |
Jul
(6) |
Aug
(1) |
Sep
|
Oct
(2) |
Nov
(1) |
Dec
|
2018 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2020 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2025 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
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) |
|
|
|
|
|
On 8/8/2009 10:09 AM John Hunter apparently wrote: > Here is the corrected example: Seems perfect! Time to study it. Thanks! Alan
On Thu, Aug 06, 2009 at 10:53:13AM -0400, Jae-Joon 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
On Sat, Aug 8, 2009 at 9:00 AM, John Hunter<jd...@gm...> 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 non-blocking 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()
On Sat, Aug 8, 2009 at 6:17 AM, Kaushik Ghose<Kau...@hm...> 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 goo-gobs 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()
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<del...@kn...> 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#plotting-guide-legend> > > 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/Python-2.6.2/lib/python2.6/site-packages/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 e-mail, 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 > e-mail, you are hereby notified that any dissemination, distribution or > copying of this e-mail, 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 e-mail and any printout > thereof. E-mail transmission cannot be guaranteed to be secure or > error-free. The sender therefore does not accept liability for any errors or > omissions in the contents of this message which arise as a result of e-mail > transmission. > NOTICE REGARDING PRIVACY AND CONFIDENTIALITY Knight Capital Group may, at > its discretion, monitor and review the content of all e-mail communications. > http://www.knight.com > > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day > 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/bobj-july > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > >
Hi Alan, Alan G Isaac wrote: > This is a second plea for help. > http://www.mail-archive.com/mat...@li.../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
Zane Selvans wrote: > Hey there, > > I'm trying to plot a bunch-o-vectors, 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.0-calc_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.0-calc_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.0-calc_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.0-calc_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 > plain-old 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/site-packages/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/site-packages/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/site-packages/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/site-packages/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/site-packages/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 30-Day > 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/bobj-july > > > ------------------------------------------------------------------------ > > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
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#plotting-guide-legend> 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/Python-2.6.2/lib/python2.6/site-packages/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 e-mail, 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 e-mail, you are hereby notified that any dissemination, distribution or copying of this e-mail, 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 e-mail and any printout thereof. E-mail transmission cannot be guaranteed to be secure or error-free. The sender therefore does not accept liability for any errors or omissions in the contents of this message which arise as a result of e-mail transmission. NOTICE REGARDING PRIVACY AND CONFIDENTIALITY Knight Capital Group may, at its discretion, monitor and review the content of all e-mail communications. http://www.knight.com