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
(10) 
2
(10) 
3
(8) 
4
(6) 
5
(10) 
6
(1) 
7
(3) 
8

9
(5) 
10
(4) 
11
(9) 
12
(6) 
13
(12) 
14
(3) 
15
(2) 
16
(13) 
17
(7) 
18
(14) 
19
(7) 
20
(3) 
21
(1) 
22

23
(8) 
24
(6) 
25
(3) 
26
(5) 
27
(10) 
28
(5) 
29
(1) 
30
(7) 





From: Eric Firing <efiring@ha...>  20120401 20:42:02

On 03/29/2012 06:29 AM, Chao YUE wrote: > Dear all, > > I make a contourf plot but I think the colorbar is too wide. Can I make > it narrower (slimmer)? > Yes, you can use the aspect kwarg. The default is 20. Try cbar = plt.colorbar(aspect=40) http://matplotlib.sourceforge.net/api/figure_api.html#matplotlib.figure.Figure.colorbar Eric > plt.contourf(data) > cbar=plt.colorbar() > > ?? > > thanks for any suggestions. > > cheers, > > Chao > >  > *********************************************************************************** > Chao YUE > Laboratoire des Sciences du Climat et de l'Environnement (LSCEIPSL) > UMR 1572 CEACNRSUVSQ > Batiment 712  Pe 119 > 91191 GIF Sur YVETTE Cedex > Tel: (33) 01 69 08 29 02; Fax:01.69.08.77.16 > ************************************************************************************ > > > >  > This SF email is sponsosred by: > Try Windows Azure free for 90 days Click Here > http://p.sf.net/sfu/sfd2dmsazure > > > > _______________________________________________ > Matplotlibusers mailing list > Matplotlibusers@... > https://lists.sourceforge.net/lists/listinfo/matplotlibusers 
From: Eric Firing <efiring@ha...>  20120401 20:37:44

On 03/30/2012 01:23 PM, Emmanuel Mayssat wrote: > Hello all, > > I can create a figure > and get the corresponding axes/plots > > for examples: > 1/ > fig = Figure(figsize=(width, height), dpi=dpi) > ax = gif.add_subplot(111) > > 2/ > fig, ax = plt.subplots() > > but I would like to create my plot independently from the figure and > assign it to a figure > > I code I would like to do something like this > > my_ax = Axes(...) > my_ax.plot(x,y) > > > ax = my_ax > > or > > my_ax.set_figure(fig) > > How can I create the axes/plot object independently from the figure? As far as I can see, you can't. The figure is deeply embedded in the Axes object; that's why the figure is an argument in Axes.__init__(). > Better yet, how can I assign an axe to a figure? I don't think you can. It looks to me like Axes.set_figure should be clearly marked as a private method, not to be used except in Axes.__init__(). Short of a major refactoring of mpl, I think you will need to find some other way of accomplishing your ultimate aim. Eric >  > Emmanuel 
From: Skipper Seabold <jsseabold@gm...>  20120401 20:35:03

On Sun, Apr 1, 2012 at 4:23 PM, Skipper Seabold <jsseabold@...> wrote: > Hi, > > I wrote an abline_plot function, and I'm curious if what I'm doing is the > best way to go about this. I tried unsuccessfully to get the transforms to > do what I want, but I'm not sure if it's possible. What I came up with is > to use callbacks to draw an "infinite" line. It works, but it seems a bit > sluggish. Does anyone have any thoughts on improvements, anything I'm > missing, or an alternative implementation? The only problem I see right now > is that it assumes ax only has one ABLine2D child. > > Hmm, it actually seems to handle multiple ablines ok, though I don't know if it's robust. Should ABLine2D take a slope and intercept in its instantiation? > Thanks, > > Skipper > > import numpy as np > from matplotlib.lines import Line2D > import matplotlib.pyplot as plt > > > ### Generate some data > intercept = 1.3 > slope = .5 > x = np.random.random(25) > y_noise = intercept + slope * x + np.random.randn(25) > > ### Set up the plot > > fig = plt.figure() > ax = fig.add_subplot(111) > ax.scatter(x, y_noise) > > class ABLine2D(Line2D): > > def update_datalim(self, ax): > ax.set_autoscale_on(False) > > children = ax.get_children() > abline = [children[i] for i in range(len(children)) > if isinstance(children[i], ABLine2D)][0] > x = ax.get_xlim() > y = [x[0]*slope+intercept, x[1]*slope+intercept] > abline.set_data(x,y) > ax.figure.canvas.draw() > > line = ABLine2D(x, y) > ax.add_line(line) > ax.callbacks.connect('xlim_changed', line.update_datalim) > ax.callbacks.connect('ylim_changed', line.update_datalim) > > plt.show() > 
From: Skipper Seabold <jsseabold@gm...>  20120401 20:24:25

Hi, I wrote an abline_plot function, and I'm curious if what I'm doing is the best way to go about this. I tried unsuccessfully to get the transforms to do what I want, but I'm not sure if it's possible. What I came up with is to use callbacks to draw an "infinite" line. It works, but it seems a bit sluggish. Does anyone have any thoughts on improvements, anything I'm missing, or an alternative implementation? The only problem I see right now is that it assumes ax only has one ABLine2D child. Thanks, Skipper import numpy as np from matplotlib.lines import Line2D import matplotlib.pyplot as plt ### Generate some data intercept = 1.3 slope = .5 x = np.random.random(25) y_noise = intercept + slope * x + np.random.randn(25) ### Set up the plot fig = plt.figure() ax = fig.add_subplot(111) ax.scatter(x, y_noise) class ABLine2D(Line2D): def update_datalim(self, ax): ax.set_autoscale_on(False) children = ax.get_children() abline = [children[i] for i in range(len(children)) if isinstance(children[i], ABLine2D)][0] x = ax.get_xlim() y = [x[0]*slope+intercept, x[1]*slope+intercept] abline.set_data(x,y) ax.figure.canvas.draw() line = ABLine2D(x, y) ax.add_line(line) ax.callbacks.connect('xlim_changed', line.update_datalim) ax.callbacks.connect('ylim_changed', line.update_datalim) plt.show() 
From: Eric Firing <efiring@ha...>  20120401 19:48:10

On 03/31/2012 07:26 AM, Marston wrote: > Hi, I'm trying to create a plot, with subplots where each row of x plots > have a common colorbar beneath it. Only the the top row will have > titles. I've tried creating a function to do this but I only achieve > partial success. Here is an image created in another program that I want > to duplicate: I made several functions to do this. Here's one of them: > def Plot(self,title,plist): for k in np.sort(self.vdic.keys()): > plt.subplot(5,13,self.window) cs = > plt.contourf(22,22,np.squeeze(self.vdic[k]),plist['levels'], > cmap=cm.get_cmap('jet',len(plist['levels'])1)) plt.axis('off') if > title: plt.title(k,fontsize=tsize) window += 1 cbar = > plt.colorbar(cax=plist['cax'],orientation='h') I've given up in getting > the text on the left because every attempt using text fails. Now if this > is a horrible way and you have a better idea, please feel free to share. > I'm new at matplotlib and this is a great way to see how things can be > done better and in different ways. The problem is that what you are trying to do is a bit too complicated for the basic pyplot interface and for subplots. The axes_grid toolkit might be helpful, or you may want to calculate the axes positions yourself as in http://matplotlib.sourceforge.net/examples/pylab_examples/multi_image.html. For your text on the left, you can add text to a figure using the same coordinates as you use for specifying axes positions: (0,0) is lower left, (1,1) is upper right. E.g., in "ipython pylab", fig = plt.figure() ax = fig.add_axes([0.4, 0.45, 0.5, 0.1]) lableft = fig.text(0.1, 0.5, "A Label") plt.draw() #needed only when interactive Eric >  > View this message in context: Subplot array and colorbar > <http://old.nabble.com/Subplotarrayandcolorbartp33544950p33544950.html>; > Sent from the matplotlib  users mailing list archive > <http://old.nabble.com/matplotlibusersf2906.html>; at Nabble.com. > > > >  > This SF email is sponsosred by: > Try Windows Azure free for 90 days Click Here > http://p.sf.net/sfu/sfd2dmsazure > > > > _______________________________________________ > Matplotlibusers mailing list > Matplotlibusers@... > https://lists.sourceforge.net/lists/listinfo/matplotlibusers 
From: David Craig <dcdavemail@gm...>  20120401 11:35:50

Hi, I am trying to use pcolor to visualise three variables. For example if I have a value for z at x and a value for z at y something like [x1, x2, x3] = [z1, z2, z3] and [y1, y2, y3] = [z2, z1, z3]. Then I use meshgrid to create the grid for x and y, X, Y = meshgrid(x, y) the result is two array's of shape (3,3). I then need to reshape Z to use pcolor, which is what I am having trouble with. I know I want a result like, y3 0 0 z3 y2 z1 0 0 y1 0 z2 0 x1 x2 x3 but have no idea how to create it. Anyone able to help?? thanks D 
From: Massimo Di Stefano <massimodisasha@gm...>  20120401 10:42:06

i modified the code as follow : def bar_plot(data, Yval, datamin=None, datamax=None): """ doc """ x = data[0] y = data[1] # reduce dataset based on min max date if datamin != datamax != None : x = data[0][np.where((data[0]>=datamin) & (data[0]<=datamax))[0]] y = data[1][np.where((data[0]>=datamin) & (data[0]<=datamax))[0]] # index for labeling xp = np.where((y<=0))[0] xn = np.where((y>0))[0] xx = np.where((y>0)  (y<=0))[0] # extract positive and negative values x_p = x[np.where(y>=0)[0]] y_p = y[np.where(y>=0)[0]] x_n = x[np.where(y<0)[0]] y_n = y[np.where(y<0)[0]] # start plotting code fig = plt.figure(figsize=(15,5)) width = 0.7 plt.autoscale(enable=True, axis='both', tight=True) plt.bar(xn, y_n, width, color='blue', lw=2) plt.xticks(xx + (width/1.2), x) plt.autoscale(enable=True, axis='both', tight=True) plt.bar(xp, y_p, width, color='red', lw=2) plt.title(Yval) fig.autofmt_xdate() plt.xlabel("Year") plt.ylabel(Yval) plt.axhline(0, color='black', lw=2) plt.grid(True) Il giorno Mar 31, 2012, alle ore 10:21 PM, Massimo Di Stefano ha scritto: > > Hi All > > i'm bring to do simple bar plot formatting the xlabe as 'date' using a syntax like : fig.autofmt_xdate(bottom=0.1) > but something is wrong in my code, please have you any hints on ghow to proper display the dates (Year) along the x axis > and how to leave a margin on the left and on the right of the plot? (my example has a margin only on the right, while the first bar is adjacent to the Y axis) > > > ### > > import numpy as np > import matplotlib.pyplot as plt > > x = np.array([1969,1970,1971,1972,1973,1974]) > y = np.array([3,10,23,4,5,6]) > data = [x,y] > > print x > print y > > > > > def bar_plot(data, Yval, datamin=None, datamax=None): > """ doc """ > fig = plt.figure() > fig.autofmt_xdate(bottom=0.1) > ax1 = fig.add_subplot(211) > x = data[0] > y = data[1] > if datamin != datamax != None : > x = data[0][np.where((data[0]>=datamin) & (data[0]<=datamax))[0]] > y = data[1][np.where((data[0]>=datamin) & (data[0]<=datamax))[0]] > x_p = x[np.where(y>=0)[0]] > y_p = y[np.where(y>=0)[0]] > x_n = x[np.where(y<0)[0]] > y_n = y[np.where(y<0)[0]] > ax1.bar(x_n, y_n, facecolor='b') > ax1.bar(x_p, y_p, facecolor='r') > ax1.grid(True) > ax1.set_xlabel('Year') > ax1.set_ylabel(Yval) > ax1.set_title(Yval) > ax1.axhline(0, color='black', lw=1) > plt.show() > > bar_plot(data, 'Var', datamin=1970, datamax=1973) > > ### 
From: Joseph Meiring <meiring@as...>  20120401 03:09:17

Thanks Tony, I think this will work! Cheers, Joe On Mar 31, 2012, at 11:33 AM, Tony Yu wrote: > > > On Fri, Mar 30, 2012 at 12:25 PM, eoj <josephmeiring@...> wrote: > > Basically the problem is like this. I have a relatively expensive (time wise) > figure to create, specifically a map with lots of detail in it. On top of > that, I'm making an inset set of axes to highlight some regions. I'm having > to recreate the base of the map, which is static, every time I want to make > an inset for a different region which is taking forever. What I want to do > is something like this: > > fig = figure() > > #do stuff that makes the expensive figure > > for region in regions: > fig2 = copy.copy(fig) > ax2 = fig.add_axes([0.1, 0.15, 0.25, 0.25]) > ax2.fill(x1,y1) > savefig(region_name) > close() > > > > The problem is that the clf() clear figure function seems to clear the base > of the map off, even if I try to make a copy of it inside a loop that is > generating the insets. Also, close() seems to close fig and not fig2. Does > this rambling make any sense, and if so, any suggestions? > > > If all your additions are confined to the inset axes, you can use `fig.delaxes` to remove the axes from the figure (see example below). If you want to save and restore, as you describe above, you should (in principal) be able to do so with `canvas.copy_from_bbox` and `canvas.restore_region`, but I couldn't get it to work (see bottom of the animation cookbook). > > Cheers, > Tony > > # ~~~ example > import numpy as np > import matplotlib.pyplot as plt > > fig, ax = plt.subplots() > ax.imshow(np.random.uniform(size=(10, 10))) > > ax_inset = fig.add_axes([0.3, 0.3, 0.2, 0.2]) > ax_inset.plot([0, 1]) > plt.savefig('plot0') > > fig.delaxes(ax_inset) > ax_inset = fig.add_axes([0.5, 0.5, 0.2, 0.2]) > ax_inset.plot([1, 0]) > plt.savefig('plot1') > # ~~~ > ======================= Joseph D. Meiring Department of Astronomy LGRT 517 University of Massachusetts Amherst MA 01003 ======================= 
From: Massimo Di Stefano <massimodisasha@gm...>  20120401 02:21:08

Hi All i'm bring to do simple bar plot formatting the xlabe as 'date' using a syntax like : fig.autofmt_xdate(bottom=0.1) but something is wrong in my code, please have you any hints on ghow to proper display the dates (Year) along the x axis and how to leave a margin on the left and on the right of the plot? (my example has a margin only on the right, while the first bar is adjacent to the Y axis) ### import numpy as np import matplotlib.pyplot as plt x = np.array([1969,1970,1971,1972,1973,1974]) y = np.array([3,10,23,4,5,6]) data = [x,y] print x print y def bar_plot(data, Yval, datamin=None, datamax=None): """ doc """ fig = plt.figure() fig.autofmt_xdate(bottom=0.1) ax1 = fig.add_subplot(211) x = data[0] y = data[1] if datamin != datamax != None : x = data[0][np.where((data[0]>=datamin) & (data[0]<=datamax))[0]] y = data[1][np.where((data[0]>=datamin) & (data[0]<=datamax))[0]] x_p = x[np.where(y>=0)[0]] y_p = y[np.where(y>=0)[0]] x_n = x[np.where(y<0)[0]] y_n = y[np.where(y<0)[0]] ax1.bar(x_n, y_n, facecolor='b') ax1.bar(x_p, y_p, facecolor='r') ax1.grid(True) ax1.set_xlabel('Year') ax1.set_ylabel(Yval) ax1.set_title(Yval) ax1.axhline(0, color='black', lw=1) plt.show() bar_plot(data, 'Var', datamin=1970, datamax=1973) ### 
From: eoj <josephmeiring@gm...>  20120401 02:04:33

Hi, Have you tried the EPD python installation, it works for me and includes SciPY/Numpy/ etc. http://www.enthought.com/products/epd_free.php Cheers, Joe William Carithers wrote: > > Hi all, > > I had matplotlib0.99.1.1 working with Python 2.6 on OS X v10.6(Snow > Leopard). Today I upgraded to Lion (v10.7) and matplotlib had disappeared. > Lion ships with Apple¹s version of Python 2.7. Even when I look back at > Python 2.6 in the /System/Library/Frameworks/Python/Version/Python2.6, it > seems to be gone. OK, I thought I would install matplotlib1.0.1 in Python > 2.7 using easy_install. It failed when unable to find the headers for > numpy > (terminal output below). Lion comes with numpy 1.5.1 preinstalled. I > tried > reinstalling numpy but that didn¹t help so now I¹m stuck. > > Any suggestions? > > Thanks. > > > c42c31f03a:matplotlib1.0.1 williamcarithers$ sudo easy_install > matplotlib > Searching for matplotlib > Reading http://pypi.python.org/simple/matplotlib/ > Reading http://matplotlib.sourceforge.net > Reading > https://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib1.0. > 1/ > Reading > http://sourceforge.net/project/showfiles.php?group_id=80706&package_id=82474 > Reading http://sourceforge.net/project/showfiles.php?group_id=80706 > Reading > https://sourceforge.net/project/showfiles.php?group_id=80706&package_id=8247 > 4 > Reading > https://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib0.99 > .1/ > Reading > https://sourceforge.net/project/showfiles.php?group_id=80706&package_id=2781 > 94 > Reading > https://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib0.99 > .3/ > Reading > https://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib1.0 > Best match: matplotlib 1.0.1 > Downloading > http://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib1.0.1 > /matplotlib1.0.1.tar.gz/download > Processing matplotlib1.0.1.tar.gz > Running matplotlib1.0.1/setup.py q bdist_egg distdir > /tmp/easy_installOI8zuY/matplotlib1.0.1/eggdisttmp3EXRXm > basedirlist is: [] > ============================================================================ > BUILDING MATPLOTLIB > matplotlib: 1.0.1 > python: 2.7.1 (r271:86832, Jun 16 2011, 16:59:05) [GCC > 4.2.1 (Based on Apple Inc. build 5658) (LLVM build > 2335.15.00)] > platform: darwin > > REQUIRED DEPENDENCIES > numpy: 1.5.1 > * Could not find the headers for numpy. You may > * need to install the development package. > error: Setup script exited with 1 > >  > uberSVN's rich system and user administration capabilities and model > configuration take the hassle out of deploying and managing Subversion and > the tools developers use with it. Learn more about uberSVN and get a free > download at: http://p.sf.net/sfu/wandiscodev2dev > > _______________________________________________ > Matplotlibusers mailing list > Matplotlibusers@... > https://lists.sourceforge.net/lists/listinfo/matplotlibusers > >  View this message in context: http://old.nabble.com/HavingtroubleinstallingmatplotlibonMacOSXLiontp32222373p33544963.html Sent from the matplotlib  users mailing list archive at Nabble.com. 