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
(16) 
2
(16) 
3
(5) 
4
(4) 
5
(4) 
6
(10) 
7
(33) 
8
(11) 
9
(20) 
10
(7) 
11
(8) 
12
(18) 
13
(27) 
14
(21) 
15
(15) 
16
(10) 
17
(12) 
18
(3) 
19
(12) 
20
(12) 
21
(14) 
22
(32) 
23
(15) 
24
(20) 
25
(12) 
26
(32) 
27
(29) 
28
(17) 
29
(25) 
30
(12) 
31
(5) 
From: Jeremy Conlin <jlconlin@gm...>  20100709 21:50:16

On Thu, Jul 8, 2010 at 8:41 AM, Jeremy Conlin <jlconlin@...> wrote: > On Sun, Jul 4, 2010 at 8:38 PM, Benjamin Root <ben.root@...> wrote: >> Jeremy, >> >> The pcolor function can take a vmin and a vmax parameter if you wish to >> control the colorscaling. In addition, you can use a special array >> structure called a "masked array" to have pcolor ignore "special" values. >> Assuming your data is 'vals': >> >> vals_masked = numpy.ma.masked_array(vals, vals == 0.0) >> >> Note that depending on your situation, doing an equality with with a >> floating point value probably isn't very reliable, so be sure to test and >> modify to suit your needs. 'vals_masked' can then be passed to pcolor >> instead of vals. > > Yes, I think this is exactly what I need. Thanks! > To follow up with my response, I tried the above and it works nicely with pyplot.pcolor. I would like to get a 3D version of this, like I get using Axes3D.plot_surface. Is this just not implemented yet? I am using 0.99.1.1. Has this been implemented in matplotlib 1.0? Thanks, Jeremy 
From: Preben Randhol <randhol@pv...>  20100709 20:10:03

Hi I'm trying to plot several subplots. I have setup a scrollwidget and viewport and I pack a canvas into a vbox in the viewport. Problem is that when I scroll, either some of the subplots are missing, or I get an error when I try to zoom on a graph that argument is not a gdk.gtk.image (or something like that) but None. I thought this was fixed in 1.0, but it isn't Please advice! Thanks in advance. Preben 
From: Ryan May <rmay31@gm...>  20100709 17:25:22

On Fri, Jul 9, 2010 at 10:49 AM, Johannes Röhrs <johannesro@...> wrote: > > > Thanks a lot, this solutions seems to serve my purpose. A new method C.remove() would of course be even better. > > One could say the problem is solved, but why does there no method exist to update a contour plot as there is for many other plot routines, i.e. > set_xdata/set_ydata for plot > set_data for imshow or > set_UVC for quiver and so on. > set_array should be the corresponding method for contour plots, and if type C.get_array() I actually get the data array that I used to plot the countours! > > My purpose of this is to animate the contour plot, and I did read somewhere that updating the plot is much faster/more efficient than deleting and recreating the plot. This is the case when setting up the initial bookkeeping is a significant portion of the time to make the plot. In this case, most of the work is in generating the contours, so I don't think you'd get much savings. (Granted, I haven't tried to verify these assumptions.) Ryan  Ryan May Graduate Research Assistant School of Meteorology University of Oklahoma 
From: Johannes Röhrs <johannesro@me...>  20100709 15:49:17

Thanks a lot, this solutions seems to serve my purpose. A new method C.remove() would of course be even better. One could say the problem is solved, but why does there no method exist to update a contour plot as there is for many other plot routines, i.e. set_xdata/set_ydata for plot set_data for imshow or set_UVC for quiver and so on. set_array should be the corresponding method for contour plots, and if type C.get_array() I actually get the data array that I used to plot the countours! My purpose of this is to animate the contour plot, and I did read somewhere that updating the plot is much faster/more efficient than deleting and recreating the plot.  Original Message  From: "Ryan May" <rmay31@...> To: "Johannes Röhrs" <johannesro@...> Cc: matplotlibusers@... Sent: Friday, 9 July, 2010 5:11:37 PM Subject: Re: [Matplotlibusers] update an existing contour plot with new data On Fri, Jul 9, 2010 at 6:28 AM, Johannes Röhrs <johannesro@...> wrote: > I have some troubles updating a contour plot. I reduced my code to a simple example to reproduce the problem: > > [code] > from pylab * > import scipy as sp > > x=sp.arange(0,2*sp.pi,0.1) > X,Y=sp.meshgrid(x,x) > f1=sp.sin(X)+sp.sin(Y) > f2=sp.cos(X)+sp.cos(Y) > > figure() > C=contourf(f1) > show() > > C.set_array(f2) > draw() > [\code] > > What do I need to do to update an existing contour plot with new data? The set_array() method (I think) only impacts the colormapping information for contourf, and even then doesn't appear to update. What you need to do is make a new contour plot and remove the old one, especially if you need to change the underlying contoured data. This should be as easy as C.remove(), but for some reason, this doesn't exist (I'll go add it in a minute). So instead, you need to do the following: import matplotlib.pyplot as plt import numpy as np x = np.arange(0, 2 * np.pi, 0.1) X,Y = np.meshgrid(x,x) f1 = np.sin(X) + np.sin(Y) f2 = np.cos(X) + np.cos(Y) plt.figure() C = plt.contourf(f1) plt.show() for coll in C.collections: plt.gca().collections.remove(coll) C = plt.contourf(f2) plt.draw() Ryan  Ryan May Graduate Research Assistant School of Meteorology University of Oklahoma 
From: Ryan May <rmay31@gm...>  20100709 15:12:07

On Fri, Jul 9, 2010 at 6:28 AM, Johannes Röhrs <johannesro@...> wrote: > I have some troubles updating a contour plot. I reduced my code to a simple example to reproduce the problem: > > [code] > from pylab * > import scipy as sp > > x=sp.arange(0,2*sp.pi,0.1) > X,Y=sp.meshgrid(x,x) > f1=sp.sin(X)+sp.sin(Y) > f2=sp.cos(X)+sp.cos(Y) > > figure() > C=contourf(f1) > show() > > C.set_array(f2) > draw() > [\code] > > What do I need to do to update an existing contour plot with new data? The set_array() method (I think) only impacts the colormapping information for contourf, and even then doesn't appear to update. What you need to do is make a new contour plot and remove the old one, especially if you need to change the underlying contoured data. This should be as easy as C.remove(), but for some reason, this doesn't exist (I'll go add it in a minute). So instead, you need to do the following: import matplotlib.pyplot as plt import numpy as np x = np.arange(0, 2 * np.pi, 0.1) X,Y = np.meshgrid(x,x) f1 = np.sin(X) + np.sin(Y) f2 = np.cos(X) + np.cos(Y) plt.figure() C = plt.contourf(f1) plt.show() for coll in C.collections: plt.gca().collections.remove(coll) C = plt.contourf(f2) plt.draw() Ryan  Ryan May Graduate Research Assistant School of Meteorology University of Oklahoma 
From: Robert Kern <robert.kern@gm...>  20100709 14:39:51

On 7/9/10 10:31 AM, per freem wrote: > Also, I am not sure how to use alan's code. > > If I try: > > ec = empirical_cdf(my_data) > plt.plot(ec) > > it doesn't actually look like a cdf Make sure my_data is sorted first. plt.plot(my_data, ec) You probably want to use one of the "steps" linestyles; I'm not sure which one would be best. It probably doesn't matter much.  Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth."  Umberto Eco 
From: per freem <perfreem@gm...>  20100709 14:31:16

Also, I am not sure how to use alan's code. If I try: ec = empirical_cdf(my_data) plt.plot(ec) it doesn't actually look like a cdf On Fri, Jul 9, 2010 at 10:17 AM, per freem <perfreem@...> wrote: > How does Alan's code compare with using cumfreq and then plotting its > result? Is the only difference that cumfreq bins the data? > > On Fri, Jul 9, 2010 at 10:12 AM, Robert Kern <robert.kern@...> wrote: >> On 7/9/10 10:02 AM, per freem wrote: >>> I'd like to clarify: I want the empirical cdf, but I want it to be >>> normalized. There's a normed=True option to plt.hist but how can I do >>> the equivalent for CDFs? >> >> There is no such thing as a normalized empirical CDF. Or rather, there is no >> such thing as an unnormalized empirical CDF. >> >> Alan's code is good. Unless if you have a truly staggering number of points, >> there is no reason to bin the data first. >> >>  >> Robert Kern >> >> "I have come to believe that the whole world is an enigma, a harmless enigma >> that is made terrible by our own mad attempt to interpret it as though it had >> an underlying truth." >>  Umberto Eco >> >> >>  >> This SF.net email is sponsored by Sprint >> What will you do first with EVO, the first 4G phone? >> Visit sprint.com/first  http://p.sf.net/sfu/sprintcomfirst >> _______________________________________________ >> Matplotlibusers mailing list >> Matplotlibusers@... >> https://lists.sourceforge.net/lists/listinfo/matplotlibusers >> > 
From: per freem <perfreem@gm...>  20100709 14:17:57

How does Alan's code compare with using cumfreq and then plotting its result? Is the only difference that cumfreq bins the data? On Fri, Jul 9, 2010 at 10:12 AM, Robert Kern <robert.kern@...> wrote: > On 7/9/10 10:02 AM, per freem wrote: >> I'd like to clarify: I want the empirical cdf, but I want it to be >> normalized. There's a normed=True option to plt.hist but how can I do >> the equivalent for CDFs? > > There is no such thing as a normalized empirical CDF. Or rather, there is no > such thing as an unnormalized empirical CDF. > > Alan's code is good. Unless if you have a truly staggering number of points, > there is no reason to bin the data first. > >  > Robert Kern > > "I have come to believe that the whole world is an enigma, a harmless enigma > that is made terrible by our own mad attempt to interpret it as though it had > an underlying truth." >  Umberto Eco > > >  > This SF.net email is sponsored by Sprint > What will you do first with EVO, the first 4G phone? > Visit sprint.com/first  http://p.sf.net/sfu/sprintcomfirst > _______________________________________________ > Matplotlibusers mailing list > Matplotlibusers@... > https://lists.sourceforge.net/lists/listinfo/matplotlibusers > 
From: Robert Kern <robert.kern@gm...>  20100709 14:12:32

On 7/9/10 10:02 AM, per freem wrote: > I'd like to clarify: I want the empirical cdf, but I want it to be > normalized. There's a normed=True option to plt.hist but how can I do > the equivalent for CDFs? There is no such thing as a normalized empirical CDF. Or rather, there is no such thing as an unnormalized empirical CDF. Alan's code is good. Unless if you have a truly staggering number of points, there is no reason to bin the data first.  Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth."  Umberto Eco 
From: per freem <perfreem@gm...>  20100709 14:02:07

I'd like to clarify: I want the empirical cdf, but I want it to be normalized. There's a normed=True option to plt.hist but how can I do the equivalent for CDFs? On Fri, Jul 9, 2010 at 9:14 AM, Alan G Isaac <alan.isaac@...> wrote: > On 7/9/2010 12:02 AM, per freem wrote: >> How can I plot the empirical CDF of an array of numbers in matplotlib >> in Python? > > > I recalled David Huard posted the below, > which apparently was once in the sandbox... > hth, > Alan Isaac > > def empiricalcdf(data, method='Hazen'): > """Return the empirical cdf. > > Methods available (here i goes from 1 to N) > Hazen: (i0.5)/N > Weibull: i/(N+1) > Chegodayev: (i.3)/(N+.4) > Cunnane: (i.4)/(N+.2) > Gringorten: (i.44)/(N+.12) > California: (i1)/N > > :see: > http://svn.scipy.org/svn/scipy/trunk/scipy/sandbox/dhuard/stats.py > :author: David Huard > """ > i = np.argsort(np.argsort(data)) + 1. > nobs = len(data) > method = method.lower() > if method == 'hazen': > cdf = (i0.5)/nobs > elif method == 'weibull': > cdf = i/(nobs+1.) > elif method == 'california': > cdf = (i1.)/nobs > elif method == 'chegodayev': > cdf = (i.3)/(nobs+.4) > elif method == 'cunnane': > cdf = (i.4)/(nobs+.2) > elif method == 'gringorten': > cdf = (i.44)/(nobs+.12) > else: > raise 'Unknown method. Choose among Weibull, Hazen, Chegodayev, > Cunnane, Gringorten and California.' > return cdf > > > > >  > This SF.net email is sponsored by Sprint > What will you do first with EVO, the first 4G phone? > Visit sprint.com/first  http://p.sf.net/sfu/sprintcomfirst > _______________________________________________ > Matplotlibusers mailing list > Matplotlibusers@... > https://lists.sourceforge.net/lists/listinfo/matplotlibusers > 
From: aliko <ali.tlisov@gm...>  20100709 13:54:28

Good day! Could You please tell me how can I get axises autoscaling in the animated plot example. I've take an example and have modifyed it slightly so the second line in plot gets out of bounding box during animation. What I need is autoscaling of axises during animation. Please point mee what I have to do. Thanks a lot! Hereafter a modifyed example:  # For detailed comments on animation and the techniqes used here, see # the wiki entry http://www.scipy.org/Cookbook/Matplotlib/Animations import sys from matplotlib.figure import Figure from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas from PyQt4 import QtGui ITERS = 100 import numpy as np import time class BlitQT(FigureCanvas): def __init__(self): FigureCanvas.__init__(self, Figure()) self.ax = self.figure.add_subplot(111) self.ax.grid() self.draw() self.old_size = self.ax.bbox.width, self.ax.bbox.height self.ax_background = self.copy_from_bbox(self.ax.bbox) self.cnt = 0 self.x = np.arange(0,2*np.pi,0.01) self.sin_line, = self.ax.plot(self.x, np.sin(self.x), animated=True) self.cos_line, = self.ax.plot(self.x, np.cos(self.x), animated=True) self.draw() self.tstart = time.time() self.startTimer(10) def timerEvent(self, evt): current_size = self.ax.bbox.width, self.ax.bbox.height if self.old_size != current_size: self.old_size = current_size self.ax.clear() self.ax.grid() self.draw() self.ax_background = self.copy_from_bbox(self.ax.bbox) self.restore_region(self.ax_background, bbox=self.ax.bbox) # update the data self.sin_line.set_ydata(np.sin(self.x+self.cnt/10.0)) self.cos_line.set_ydata((self.x+self.cnt)/50.0) # just draw the animated artist self.ax.draw_artist(self.sin_line) self.ax.draw_artist(self.cos_line) # just redraw the axes rectangle self.blit(self.ax.bbox) if self.cnt == 0: # TODO: this shouldn't be necessary, but if it is excluded the # canvas outside the axes is not initially painted. self.draw() if self.cnt==ITERS: # print the timing info and quit print 'FPS:' , ITERS/(time.time()self.tstart) sys.exit() else: self.cnt += 1 app = QtGui.QApplication(sys.argv) widget = BlitQT() widget.show() sys.exit(app.exec_()) 
From: Alan G Isaac <alan.isaac@gm...>  20100709 13:14:58

On 7/9/2010 12:02 AM, per freem wrote: > How can I plot the empirical CDF of an array of numbers in matplotlib > in Python? I recalled David Huard posted the below, which apparently was once in the sandbox... hth, Alan Isaac def empiricalcdf(data, method='Hazen'): """Return the empirical cdf. Methods available (here i goes from 1 to N) Hazen: (i0.5)/N Weibull: i/(N+1) Chegodayev: (i.3)/(N+.4) Cunnane: (i.4)/(N+.2) Gringorten: (i.44)/(N+.12) California: (i1)/N :see: http://svn.scipy.org/svn/scipy/trunk/scipy/sandbox/dhuard/stats.py :author: David Huard """ i = np.argsort(np.argsort(data)) + 1. nobs = len(data) method = method.lower() if method == 'hazen': cdf = (i0.5)/nobs elif method == 'weibull': cdf = i/(nobs+1.) elif method == 'california': cdf = (i1.)/nobs elif method == 'chegodayev': cdf = (i.3)/(nobs+.4) elif method == 'cunnane': cdf = (i.4)/(nobs+.2) elif method == 'gringorten': cdf = (i.44)/(nobs+.12) else: raise 'Unknown method. Choose among Weibull, Hazen, Chegodayev, Cunnane, Gringorten and California.' return cdf 
From: John Hunter <jdh2358@gm...>  20100709 12:53:09

On Fri, Jul 9, 2010 at 7:25 AM, Karianne Holhjem <karianne@...> wrote: > Regarding numpy  what you say is intersting. I couldn't find any such > problems in my googlesearches. I am running version 1.2.1: > [karianneholhjem:/] karianne% python c 'import numpy; print numpy.__version__' > 1.2.1 Can you try upgrading numpy to the latest released version? This is likely your problem. I would rm rf the old numpy in your sitepackages directory and upgrade to 1.4.1 https://sourceforge.net/projects/numpy/files/NumPy/1.4.1/numpy1.4.1py2.5python.org.dmg/download Are you using python.org python or Apple python  it appears the installer above is for python.org python JDH 
From: Karianne Holhjem <karianne@as...>  20100709 12:42:25

Hi, I changed the script to what you suggested and this is the output: [karianneholhjem:~] karianne% python bla.py verbosehelpful $HOME=/Users/karianne CONFIGDIR=/Users/karianne/.matplotlib matplotlib data path /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/sitepackages/matplotlib/mpldata loaded rc file /Users/karianne/.matplotlib/matplotlibrc matplotlib version 1.0.0 verbose.level helpful interactive is False units is False platform is darwin Bus error I get the same output when commenting out either line 2 or 3. (/Users/karianne/.matplotlib/matplotlibrc is just a link to /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/sitepackages/matplotlib/mpldata/matplotlibrc as was in my previous output.) Regarding numpy  what you say is intersting. I couldn't find any such problems in my googlesearches. I am running version 1.2.1: [karianneholhjem:/] karianne% python c 'import numpy; print numpy.__version__' 1.2.1 I couldn't find the version requirements in the README file so I probably found the wrong README (/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/sitepackages/numpy/README.txt). It did provide a way of testing numpy, I don't know if it's interesting but here is the output: [karianneholhjem:/] karianne% python c 'import numpy; numpy.test()' Running unit tests for numpy NumPy version 1.2.1 NumPy is installed in /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/sitepackages/numpy Python version 2.5.2 (r252:60911, Feb 22 2008, 07:57:53) [GCC 4.0.1 (Apple Computer, Inc. build 5363)] nose version 0.11.3 ...........................................................................................................................................................................................................................................................................................................................................................................................................................................................K................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................  Ran 1740 tests in 8.691s OK (KNOWNFAIL=1) Is there any more information I can provide to give you clues as of why pyplot and pylab aren't working? Thank you for your help so far, I did a course on python/numpy/matplotlib and I would really like to use matplotlib as it is a really powerful plotting tool! cheers, Karianne On Thu, 8 Jul 2010, John Hunter wrote: > On Thu, Jul 8, 2010 at 5:50 AM, Karianne Holhjem > <karianne@...> wrote: > > Hi, > > > > I'm having trouble getting pyplot and pylab to work on my Mac v.10.4.11 > > (Tiger). I've tried searching in both google and different macusers > > forums, but haven't found an answer to my problems. If I have overlooked a > > webpage please send me a link to the solution. > > > > To download matplotlib I have downloaded the dmg package from the official > > matplotlib page > > http://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib1.0/http://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib1.0/ > > > > and it seems to install fine. However, I cannot use neither pyplot nor > > pylab: > > > You're on the right track with the debugging information you are > trying to provide. One problem is in your script bla.py. You do > > import matplotlib as mpl > import mpl.pyplot > import mpl.pylab > > but you need to do > > import matplotlib as mpl > import matplotlib.pyplot > import matplotlib.pylab > > This won't fix your segfault, but it may help you get get better > debugging information. > > My first guess is a numpy version conflict  what version are you > running? You can check the version requirements of the OSX installer > in the README that is provides. Many recent versions of numpy are not > ABI compatible, unfortunately. > > JDH > 
From: Johannes Röhrs <johannesro@me...>  20100709 11:44:54

Hi, I have some troubles updating a contour plot. I reduced my code to a simple example to reproduce the problem: [code] from pylab * import scipy as sp x=sp.arange(0,2*sp.pi,0.1) X,Y=sp.meshgrid(x,x) f1=sp.sin(X)+sp.sin(Y) f2=sp.cos(X)+sp.cos(Y) figure() C=contourf(f1) show() C.set_array(f2) draw() [\code] The problem is that C.set_array(f2) does not show any effect, not even after I call draw(). Shouldn't the array f2 be displayed after that? In comparison, the following code using imshow instead of contour works well: [code] figure() I=imshow(f1) show() I.set_data(f2) draw() [\code] What do I need to do to update an existing contour plot with new data? Greetings Johannes 
From: Janne Blomqvist <blomqvist.janne@gm...>  20100709 10:34:22

Hi, I posted this to stackoverflow (http://stackoverflow.com/questions/3190798/scalelegendboxborderdashedanddottedlineswhenthefiguresizeischanged), but didn't get any answer, so here goes again: I'm trying to use matplotlib to prepare some figures for publication. In order to make the font sizes match the text of the manuscript I'm trying to create the figure in the final size to begin with, so that I avoid scaling the figure when inserting it into the manuscript. The problem I'm having is that as the figure is then pretty small, I can scale font sizes, axis sizes, line widths etc., but what I've been unable to figure out is how to scale dashed or dotted lines, as well as the thickness of the legend border box. For a simplified and somewhat exaggerated example, consider #!/usr/bin/python small = True from matplotlib import use use('pdf') from matplotlib import rc rc('ps', usedistiller='xpdf') rc('text', usetex=True) if small: figsize = (1.0, 0.5) rc('font', size=2) rc('axes', labelsize=2, linewidth=0.2) rc('legend', fontsize=2, handlelength=10) rc('xtick', labelsize=2) rc('ytick', labelsize=2) rc('lines', lw=0.2, mew=0.2) rc('grid', linewidth=0.2) else: figsize = (8,8) import numpy as np x = np.arange(0, 10, 0.001) y = np.sin(x) import matplotlib.pyplot as plt f = plt.figure(figsize=figsize) a = f.add_subplot(111) a.plot(x, y, '', label='foo bar') a.legend() f.savefig('mplt.pdf') If you change the first executable line to small = False you can see how it should look in "normal" size. Compared to the normal size, the small plot suffers from a legend box with too thick borders, and the dashed line is too coarse, i.e. too long dashes and too long distance between the dashes. So my question is, is there a way to fix these two problems? The matplotlib version I'm using is 0.99.1.2 on ubuntu 10.04 amd64.  Janne Blomqvist 
From: Pim Schellart <P.S<chellart@as...>  20100709 09:58:51

Dear Matplotlib developers, first of all my congratulations with the excellent 1.0 release, great work! I currently use a custom compiled 64 bit version of Python 2.6. But I would like to switch to the prebuild binaries for Python 2.7 as soon as possible. Are there any plans for supplying matplotlib 1.x dmg installers for Python 2.7 (including 64 bit support on OSX)? Kind regards, Pim Schellart P.S. I quickly tried compiling matplotlib from source against Python 2.7 which worked (after setting PREFIX=/usr/local and PYVERSION=2.7 in make.osx and compiling with sudo make f make.osx fetch deps mpl_build mpl_install && sudo python setup.py install) but failed with a segfault on import. 
From: Matthias Michler <MatthiasM<ichler@gm...>  20100709 08:10:36

On Friday July 9 2010 06:02:58 per freem wrote: > How can I plot the empirical CDF of an array of numbers in matplotlib > in Python? I'm looking for the cdf analog of pylab's "hist" function. > > One thing I can think of is: > > from scipy.stats import cumfreq > a = array([...]) # my array of numbers > num_bins = 20 > b = cumfreq(a, num_bins) > plt.plot(b) > > Is that correct though? Is there an easier/better way? Hi, I would use pyplot.hist to produce a histogram with a bar for each bin. By use of the keyword argument 'cumulative' you can select cumulative frequency distribution instead of density. Kind regards, Matthias 
From: Matthias Michler <MatthiasM<ichler@gm...>  20100709 07:59:56

On Friday July 9 2010 00:06:05 Shir J. Livne wrote: > Hello, > > I keep getting the error "ValueError: Need more than 1 value to unpack" > every time I try to use the line ax.plot_wireframe(myArray[:,0], > myArray[:,1], myArray[:,2]) > > What does that error mean? Hi Shir, I think you used 1darrays for myArray[:, i] and the plot_wireframe method expects 2darrays for x, y and z, respectively. Inside the plot_wireframe method the shape of Z is transformed into number of rows and columns: rows, cols = Z.shape and that is the point where you get the ValueError, because Z.shape is only one element. You may also want to look at the examples: http://matplotlib.sourceforge.net/examples/mplot3d/wire3d_animation_demo.html http://matplotlib.sourceforge.net/examples/mplot3d/wire3d_demo.html If this doesn't help, it would be useful if you would set up a small stand alone example illustrating your problem with some simple data with the shape of myArray. Kind regards, Matthias 
From: per freem <perfreem@gm...>  20100709 04:03:08

How can I plot the empirical CDF of an array of numbers in matplotlib in Python? I'm looking for the cdf analog of pylab's "hist" function. One thing I can think of is: from scipy.stats import cumfreq a = array([...]) # my array of numbers num_bins = 20 b = cumfreq(a, num_bins) plt.plot(b) Is that correct though? Is there an easier/better way? thanks. 