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
(3) |
2
(9) |
3
(6) |
4
(2) |
5
(19) |
6
(7) |
7
(3) |
8
(5) |
9
(6) |
10
(13) |
11
(19) |
12
(16) |
13
(9) |
14
(17) |
15
(5) |
16
(12) |
17
(12) |
18
(5) |
19
(16) |
20
(10) |
21
(9) |
22
(3) |
23
(8) |
24
(5) |
25
(13) |
26
(11) |
27
(21) |
28
(9) |
29
(11) |
30
(6) |
31
(5) |
|
|
|
|
From: Eric F. <ef...@ha...> - 2012-07-31 23:20:04
|
On 2012/07/30 1:17 AM, Jeffrey Spencer wrote: > I'd agree as then it would work as pcolormesh or imshow does which when > passed in the same norm will only set vmin or vmax that wasn't > previously set. > > Assume this would be a really easy fix but I can have a look at > submitting a patch if someone else isn't going to do so just let me know. I will take care of it, thanks. Eric > > Cheers, > Jeff > > On Mon, Jul 30, 2012 at 2:31 AM, Eric Firing <ef...@ha... > <mailto:ef...@ha...>> wrote: > > On 2012/07/29 5:13 AM, Jeffrey Spencer wrote: > > Eric, > > Normalize appears to be working correctly and as you stated > above but > when passed into contourf appears to have inconsistent results not > following the docstring by allowing the value to change. > > Quick examples: > > X, Y = meshgrid(arange(20),arange(20)__) > Z = arange(20*20) > Z = Z.reshape(20,20) > norm = colors.Normalize(vmin=200,__vmax=None) > print norm.vmin > fig = figure(10) > ax = fig.add_subplot(111) > surf = ax.contourf(X,Y,Z, 100, cmap=matplotlib.cm.jet, norm = norm) > > This vmin has no effect where if you pass in: > > X, Y = meshgrid(arange(20),arange(20)__) > Z = arange(20*20) > Z = Z.reshape(20,20) > norm = colors.Normalize(vmin=200,__vmax=Z.max()) > print norm.vmin > fig = figure(10) > ax = fig.add_subplot(111) > surf = ax.contourf(X,Y,Z, 100, cmap=matplotlib.cm.jet, norm = norm) > > it has the desired effect. > > Let me know if this is correct or I'm missing something here. > > Cheers, > Jeff > > > You are correct. Contour and contourf are respecting vmin, vmax > that have been set in the norm only if both have been set, so that > it is fully scaled. I think that changing this to respect a single > preset vmin or vmax would be reasonable. > > Eric > > |
From: surfcast23 <sur...@gm...> - 2012-07-31 22:07:03
|
I also got the dimensions of the arrays and was wandering if the problem might be there shape data = (101, 512) shape v = (512, 512) shape tdata = (101, 1) shape x = (512,) Benjamin Root-2 wrote: > > On Sun, Jul 1, 2012 at 12:50 PM, surfcast23 <sur...@gm...> wrote: > >> >> Hi, >> I am translating a Matlab code to python and get the following error >> when >> the codes reaches the plotting section >> >> Warning (from warnings module): >> File "C:\Documents and Settings\My Documents\PHYSICS\Wave-eqn.py", line >> 40 >> w = (D*v) >> RuntimeWarning: overflow encountered in multiply >> Traceback (most recent call last): >> File "C:\Documents and Settings\My Documents\PHYSICS\Wave-eqn\.py", >> line >> 50, in <module> >> ax.plot_wireframe(x,tdata,data, rstride=10, cstride=10) >> File "C:\Python32\lib\site-packages\mpl_toolkits\mplot3d\axes3d.py", >> line >> 906, in plot_wireframe >> tylines = [tY[i] for i in cii] >> File "C:\Python32\lib\site-packages\mpl_toolkits\mplot3d\axes3d.py", >> line >> 906, in <listcomp> >> tylines = [tY[i] for i in cii] >> IndexError: index out of bounds >> >> My code >> >> import numpy as np >> from numpy import * >> from math import pi >> from scipy.linalg import toeplitz >> from scipy.special import cotdg >> from mpl_toolkits.mplot3d import axes3d >> import matplotlib.pyplot as plt >> >> >> >> N = 512 >> h = 2*np.pi/N >> x = h*(np.arange(N) + 1) >> t = 0 >> dt = h / 4 >> a = .1 >> tmax = 15; >> tplot = .15; >> nplots = int(round((tmax/tplot))); >> plotgap = int(around(tplot/dt)); >> c = a + np.sin(x - 1)**2 >> v = np.exp(-100 * (x - 1)**2) >> vold = np.exp(-100 * (x - a*dt - 1)**2) >> >> #i = np.arange(1, N) >> #column = np.hstack([0, .5 * (-1**i) * cotdg(i * h/2)]) >> #D = toeplitz(column, -column) >> >> column = ((0.5*(-1)**arange(1,N+1))*cotdg(arange(1,N+1))*(h/2)); >> D = toeplitz(column,-column);print(D.shape); >> >> k = np.zeros(((nplots,N))); print(v.shape);print(k.shape); >> data = np.concatenate((v.reshape((512,1)).transpose(), k))#data = >> np.concatenate((v, k),axis = 1); >> #data = np.vstack([v,k]); >> tdata = t; >> >> for i in range(1,nplots+1): >> for n in range(1,plotgap+1): >> t = t+dt >> w = (D*v) >> vnew = vold-2*dt*c*w >> vold = v >> v = vnew >> data[i,:] = v[0,:] >> tdata = vstack([tdata, t]) >> >> fig = plt.figure() >> ax = fig.add_subplot(111, projection='3d') >> #X, Y, Z = axes3d.get_test_data(0.05) >> ax.plot_wireframe(x,tdata,data, rstride=10, cstride=10) >> >> plt.show() >> >> I looked at the error line and it seems as if the y axes is where the >> problem is, but I am not seeing why and would appreciate any help. Thank >> you! >> > > numpy arrays are indexed starting at 0, not 1. So when you populate your > "data" array with "data[i,:] = v[0,:]", and "i" only goes from 1 to > nplots, > data[0,:] is left completely uninitialized (unless it is being done by > some > of your pre-for-loop code, which is confusing to understand.) > > What I can tell you is that the error isn't in plot_wireframe() as much as > the error exist with the inputs to plot_wireframe(). Perhaps the shapes > aren't right or something. I will try and look at your code closer > tomorrow and see if I can figure it out, but I suggest double-checking > those arrays. > > Cheers! > Ben Root > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > -- View this message in context: http://old.nabble.com/IndexError%3A-index-out-of-bounds-tp34098663p34238189.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
From: surfcast23 <sur...@gm...> - 2012-07-31 20:43:40
|
Hi Ben, I was working on some other things and have finally gotten a chance to get back to this. I changed the for loops to for i in range(nplots): for n in range(plotgap): t = t+dt w = (D*v) vnew = vold-2*dt*c*w vold = v v = vnew data[i,:] = v[0,:] tdata = vstack([tdata, t]) But I still get the same error as in my original post. Khary surfcast23 wrote: > > I will try initializing starting at 0 > > Benjamin Root-2 wrote: >> >> On Sun, Jul 1, 2012 at 12:50 PM, surfcast23 <sur...@gm...> wrote: >> >>> >>> Hi, >>> I am translating a Matlab code to python and get the following error >>> when >>> the codes reaches the plotting section >>> >>> Warning (from warnings module): >>> File "C:\Documents and Settings\My Documents\PHYSICS\Wave-eqn.py", >>> line >>> 40 >>> w = (D*v) >>> RuntimeWarning: overflow encountered in multiply >>> Traceback (most recent call last): >>> File "C:\Documents and Settings\My Documents\PHYSICS\Wave-eqn\.py", >>> line >>> 50, in <module> >>> ax.plot_wireframe(x,tdata,data, rstride=10, cstride=10) >>> File "C:\Python32\lib\site-packages\mpl_toolkits\mplot3d\axes3d.py", >>> line >>> 906, in plot_wireframe >>> tylines = [tY[i] for i in cii] >>> File "C:\Python32\lib\site-packages\mpl_toolkits\mplot3d\axes3d.py", >>> line >>> 906, in <listcomp> >>> tylines = [tY[i] for i in cii] >>> IndexError: index out of bounds >>> >>> My code >>> >>> import numpy as np >>> from numpy import * >>> from math import pi >>> from scipy.linalg import toeplitz >>> from scipy.special import cotdg >>> from mpl_toolkits.mplot3d import axes3d >>> import matplotlib.pyplot as plt >>> >>> >>> >>> N = 512 >>> h = 2*np.pi/N >>> x = h*(np.arange(N) + 1) >>> t = 0 >>> dt = h / 4 >>> a = .1 >>> tmax = 15; >>> tplot = .15; >>> nplots = int(round((tmax/tplot))); >>> plotgap = int(around(tplot/dt)); >>> c = a + np.sin(x - 1)**2 >>> v = np.exp(-100 * (x - 1)**2) >>> vold = np.exp(-100 * (x - a*dt - 1)**2) >>> >>> #i = np.arange(1, N) >>> #column = np.hstack([0, .5 * (-1**i) * cotdg(i * h/2)]) >>> #D = toeplitz(column, -column) >>> >>> column = ((0.5*(-1)**arange(1,N+1))*cotdg(arange(1,N+1))*(h/2)); >>> D = toeplitz(column,-column);print(D.shape); >>> >>> k = np.zeros(((nplots,N))); print(v.shape);print(k.shape); >>> data = np.concatenate((v.reshape((512,1)).transpose(), k))#data = >>> np.concatenate((v, k),axis = 1); >>> #data = np.vstack([v,k]); >>> tdata = t; >>> >>> for i in range(1,nplots+1): >>> for n in range(1,plotgap+1): >>> t = t+dt >>> w = (D*v) >>> vnew = vold-2*dt*c*w >>> vold = v >>> v = vnew >>> data[i,:] = v[0,:] >>> tdata = vstack([tdata, t]) >>> >>> fig = plt.figure() >>> ax = fig.add_subplot(111, projection='3d') >>> #X, Y, Z = axes3d.get_test_data(0.05) >>> ax.plot_wireframe(x,tdata,data, rstride=10, cstride=10) >>> >>> plt.show() >>> >>> I looked at the error line and it seems as if the y axes is where the >>> problem is, but I am not seeing why and would appreciate any help. Thank >>> you! >>> >> >> numpy arrays are indexed starting at 0, not 1. So when you populate your >> "data" array with "data[i,:] = v[0,:]", and "i" only goes from 1 to >> nplots, >> data[0,:] is left completely uninitialized (unless it is being done by >> some >> of your pre-for-loop code, which is confusing to understand.) >> >> What I can tell you is that the error isn't in plot_wireframe() as much >> as >> the error exist with the inputs to plot_wireframe(). Perhaps the shapes >> aren't right or something. I will try and look at your code closer >> tomorrow and see if I can figure it out, but I suggest double-checking >> those arrays. >> >> Cheers! >> Ben Root >> >> ------------------------------------------------------------------------------ >> Live Security Virtual Conference >> Exclusive live event will cover all the ways today's security and >> threat landscape has changed and how IT managers can respond. Discussions >> will include endpoint security, mobile security and the latest in malware >> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> >> > > -- View this message in context: http://old.nabble.com/IndexError%3A-index-out-of-bounds-tp34098663p34237855.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
From: Vlastimil B. <vla...@gm...> - 2012-07-31 15:36:31
|
2012/7/31 Benjamin Root <ben...@ou...>: > > > On Sun, Jul 29, 2012 at 7:39 PM, Vlastimil Brom <vla...@gm...> > wrote: >> >> 2012/7/30 Benjamin Root <ben...@ou...>: >> > >> > >> > On Sunday, July 29, 2012, Vlastimil Brom wrote: >> >> >> >> Hi all, >> >> I'd like to ask about the possibility to eventually reuse the gui of >> >> pylab for showing and manipulating the plots in the custom application >> >> (written in wxpython). >> >> [...] >> >> Thanks in advance for any hints >> >> regards >> >> Vlastimil Brom >> > >> > >> > Absolutely! It is one of the things mpl does best. Do a search in the >> > online >> > documentation for "embedding codex". >> > >> > I hope that helps! >> > >> > Ben Root >> >> Thanks for the quick response and a useful hint! >> >> I apparently didn't search for the right terms before... >> I turns out, that >> >> http://matplotlib.sourceforge.net/examples/user_interfaces/embedding_in_wx2.html >> shows exactly, what I need. >> >> By the way is there a place to propose a small correction of the example >> code? >> namely >> self.SetBackgroundColour(wx.NamedColor("WHITE")) >> >> causes an error in wxpython 2.9, which removed the "...Color" aliases >> and only knows "...Colour" >> hence: >> >> self.SetBackgroundColour(wx.NamedColour("WHITE")) >> >> works in wxpython 2.9 and should be backwards compatible too. >> >> Thanks again, >> vbr >> > > Thanks for catching that mistake. Unfortunately, we don't do a good enough > job of keeping up to date on changes in various backends. The best way to > make sure that gets fixed is to send us a pull request on github. At the > very least, post an issue report on it. > > Ben > Thanks, I created an issue: https://github.com/matplotlib/matplotlib/issues/1048 about this and also tried to send the pull requests about the four "wx.NamedColor" occurrences I could find. Unfortunately, I haven't any experiences with code management tools and github infrastructure, I didn't mess something up. Regards, vbr |
From: Benjamin R. <ben...@ou...> - 2012-07-31 13:04:37
|
On Sun, Jul 29, 2012 at 7:39 PM, Vlastimil Brom <vla...@gm...>wrote: > 2012/7/30 Benjamin Root <ben...@ou...>: > > > > > > On Sunday, July 29, 2012, Vlastimil Brom wrote: > >> > >> Hi all, > >> I'd like to ask about the possibility to eventually reuse the gui of > >> pylab for showing and manipulating the plots in the custom application > >> (written in wxpython). > >> [...] > >> Thanks in advance for any hints > >> regards > >> Vlastimil Brom > > > > > > Absolutely! It is one of the things mpl does best. Do a search in the > online > > documentation for "embedding codex". > > > > I hope that helps! > > > > Ben Root > > Thanks for the quick response and a useful hint! > > I apparently didn't search for the right terms before... > I turns out, that > > http://matplotlib.sourceforge.net/examples/user_interfaces/embedding_in_wx2.html > shows exactly, what I need. > > By the way is there a place to propose a small correction of the example > code? > namely > self.SetBackgroundColour(wx.NamedColor("WHITE")) > > causes an error in wxpython 2.9, which removed the "...Color" aliases > and only knows "...Colour" > hence: > > self.SetBackgroundColour(wx.NamedColour("WHITE")) > > works in wxpython 2.9 and should be backwards compatible too. > > Thanks again, > vbr > > Thanks for catching that mistake. Unfortunately, we don't do a good enough job of keeping up to date on changes in various backends. The best way to make sure that gets fixed is to send us a pull request on github. At the very least, post an issue report on it. Ben |
From: Dmitrey <dmi...@uk...> - 2012-07-30 16:12:09
|
Hi all, recently I have implemented some new functionality for the free geometric software SpaceFuncs <http://openopt.org/SpaceFuncs> and would like to introduce a couple of optimization examples with Olympic rings, devoted to the Olympic games - 2012, that are going on now. They are valid for upcoming <http://openopt.org/coming> version of SpaceFuncs <http://openopt.org/SpaceFuncs> only (already available in subversion repository). In similar way you can solve systems of linear/nonlinear geometrical (in any space dimension) equations (see OpenOpt SLE <http://openopt.org/SLE> and SNLE <http://openopt.org/SNLE>). Graphical output is powered by matplotlib <http://matplotlib.sourceforge.net/>. 1. Let's search 5 points (1 from each ring) that form polygon with maximum area. Code is here <http://openopt.org/SpaceFuncsDoc#An_example_with_olympic_circles> (or here <http://trac.openopt.org/openopt/browser/PythonPackages/SpaceFuncs/examples/maxArea.py>). max area 2. Well, (1) was quite easy problem that could be done by many ways with many different software. Let's consider more difficult example. Suppose we have several points with different positive or negative weights and would like to place them in the olympic circles so that their centroid (barycenter) would be as close to a target as possible; let's also demand distance between any 2 points has to be no less than 0.15. It is difficult combinatorial optimization problem - each point may belong to one of 5 circles, so number of possibilities is 5^m, where m is number of points; moreover, we have m * (m-1) / 2 difficult nonlinear nonconvex equality constraints (requirements on distances). Fortunately, OpenOpt has awesome solver interalg <http://openopt.org/interalg>, that easily solves this problem (for quite small m, although), moreover, with specifiable accuracy fTol: abs(f-f*) <= fTol; we will consider 3 points of weights [15, -0.15, 3]. Code is here <http://openopt.org/SpaceFuncsDoc#Another_example_with_olympic_circles> (or here <http://trac.openopt.org/openopt/browser/PythonPackages/SpaceFuncs/examples/centroid.py>) centroid Best wishes for you country in the Olympic games, D. ------------------------------------ http://openopt.org/Dmitrey |
From: Francesco M. <fra...@gm...> - 2012-07-30 15:34:16
|
Hi, 2012/7/30 oc-spam65 <oc-...@la...>: > Hello, > > Can the 'zorder' of the ticks be set? This minimal example shows a > hard-coded value of 2.5 > > This may come from file "matplotlib/axes.py", function "draw()". Can it > be adjusted? Shall it be bug-reported? > > ####################################################################### > import matplotlib.pyplot as pyplot > > fig = pyplot.figure() > ax = fig.add_subplot("111") > > ax.add_patch(pyplot.Rectangle((0,0), 1, 1, zorder=3)) > ax.xaxis.set_zorder(4) > # Expected behavior: the ticks should be drawn after the Rectangle, > # because 4 > 3. They should therefore be visible. > > pyplot.show() > # Problem: The ticks are hidden by the rectangle, contrary to the > # expected behavior. > > print(ax.xaxis.get_zorder()) > # Prints 2.5 instead of 4! > > ####################################################################### I confirm the bug on matplotlib v: 1.1.0, Kubuntu 11.04, Python 2.7.1+ >>> ax.xaxis.set_zorder(4) >>> ax.xaxis.get_zorder() >>>> 4 >>> plt.draw() >>> ax.xaxis.get_zorder() It seems that the call to draw or show sets the zorder to default, instead of updating it. @Mr Spam (can you sign your mail, please) In one of my scripts managed to set zorder to the spines as, e.g., ax.spines['left'].set_zorder(101). This puts the axis spine well on top, but ax.xaxis.set_zorder does nothing. I've also found a method ax.tick_params, that has a zorder keyword, but it does nothing too. Cheers, Francesco > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
From: oc-spam65 <oc-...@la...> - 2012-07-30 15:10:33
|
Hello, Can the 'zorder' of the ticks be set? This minimal example shows a hard-coded value of 2.5 This may come from file "matplotlib/axes.py", function "draw()". Can it be adjusted? Shall it be bug-reported? ####################################################################### import matplotlib.pyplot as pyplot fig = pyplot.figure() ax = fig.add_subplot("111") ax.add_patch(pyplot.Rectangle((0,0), 1, 1, zorder=3)) ax.xaxis.set_zorder(4) # Expected behavior: the ticks should be drawn after the Rectangle, # because 4 > 3. They should therefore be visible. pyplot.show() # Problem: The ticks are hidden by the rectangle, contrary to the # expected behavior. print(ax.xaxis.get_zorder()) # Prints 2.5 instead of 4! ####################################################################### |
From: Jeffrey S. <jef...@gm...> - 2012-07-30 11:17:42
|
I'd agree as then it would work as pcolormesh or imshow does which when passed in the same norm will only set vmin or vmax that wasn't previously set. Assume this would be a really easy fix but I can have a look at submitting a patch if someone else isn't going to do so just let me know. Cheers, Jeff On Mon, Jul 30, 2012 at 2:31 AM, Eric Firing <ef...@ha...> wrote: > On 2012/07/29 5:13 AM, Jeffrey Spencer wrote: > >> Eric, >> >> Normalize appears to be working correctly and as you stated above but >> when passed into contourf appears to have inconsistent results not >> following the docstring by allowing the value to change. >> >> Quick examples: >> >> X, Y = meshgrid(arange(20),arange(20)**) >> Z = arange(20*20) >> Z = Z.reshape(20,20) >> norm = colors.Normalize(vmin=200,**vmax=None) >> print norm.vmin >> fig = figure(10) >> ax = fig.add_subplot(111) >> surf = ax.contourf(X,Y,Z, 100, cmap=matplotlib.cm.jet, norm = norm) >> >> This vmin has no effect where if you pass in: >> >> X, Y = meshgrid(arange(20),arange(20)**) >> Z = arange(20*20) >> Z = Z.reshape(20,20) >> norm = colors.Normalize(vmin=200,**vmax=Z.max()) >> print norm.vmin >> fig = figure(10) >> ax = fig.add_subplot(111) >> surf = ax.contourf(X,Y,Z, 100, cmap=matplotlib.cm.jet, norm = norm) >> >> it has the desired effect. >> >> Let me know if this is correct or I'm missing something here. >> >> Cheers, >> Jeff >> > > You are correct. Contour and contourf are respecting vmin, vmax that have > been set in the norm only if both have been set, so that it is fully > scaled. I think that changing this to respect a single preset vmin or vmax > would be reasonable. > > Eric > > |
From: Mark B. <ma...@gm...> - 2012-07-30 09:54:19
|
Hello List, I am trying to determine the position of the axes after an imshow and am having problems. I get a different answer on my Mac (the correct answer) than Windows (the wrong answer). I have a file called testimage.py with 5 lines: from pylab import * c = ones((10,20)) ax = imshow(c) show() print ax.get_axes().get_position() I run this file from IPython. On my Mac I get: run testimage Bbox(array([[ 0.125 , 0.24166667], [ 0.9 , 0.75833333]])) On Windows I get (the wrong answer): run testimage Bbox(array([[ 0.125, 0.1 ], [0.9, 0.9 ]])) Any thoughts? When I type the commands in at the IPython prompt it works most of the time (on Windows), but it never works when running the file. What in the world could be different? mp version 1.1.0 on both systems. Thanks for your help, Mark |
From: Damien I. <dam...@ya...> - 2012-07-30 01:35:58
|
When using an equidistant cylindrical projection over a selected subregion of the globe, e.g. map = Basemap(llcrnrlon=50,llcrnrlat=-80,urcrnrlon=300,urcrnrlat=70,projection='cyl'), any contour plot that I try and generate (i.e. any plot generated using the map.contour() function) cannot plot any values south of 10N. In other words, everything south of 10N just shows up blank on the plot. It works fine for filled contours (i.e. map.contourf()), but not for simple contour lines (map.contour()). Has anyone else come across this issue? |
From: Vlastimil B. <vla...@gm...> - 2012-07-29 23:40:00
|
2012/7/30 Benjamin Root <ben...@ou...>: > > > On Sunday, July 29, 2012, Vlastimil Brom wrote: >> >> Hi all, >> I'd like to ask about the possibility to eventually reuse the gui of >> pylab for showing and manipulating the plots in the custom application >> (written in wxpython). >> [...] >> Thanks in advance for any hints >> regards >> Vlastimil Brom > > > Absolutely! It is one of the things mpl does best. Do a search in the online > documentation for "embedding codex". > > I hope that helps! > > Ben Root Thanks for the quick response and a useful hint! I apparently didn't search for the right terms before... I turns out, that http://matplotlib.sourceforge.net/examples/user_interfaces/embedding_in_wx2.html shows exactly, what I need. By the way is there a place to propose a small correction of the example code? namely self.SetBackgroundColour(wx.NamedColor("WHITE")) causes an error in wxpython 2.9, which removed the "...Color" aliases and only knows "...Colour" hence: self.SetBackgroundColour(wx.NamedColour("WHITE")) works in wxpython 2.9 and should be backwards compatible too. Thanks again, vbr |
From: Benjamin R. <ben...@ou...> - 2012-07-29 22:25:05
|
On Sunday, July 29, 2012, Vlastimil Brom wrote: > Hi all, > I'd like to ask about the possibility to eventually reuse the gui of > pylab for showing and manipulating the plots in the custom application > (written in wxpython). > Basically, I'd like to add some application specific controls to the > toolbar, or to place the existing gui to a custom frame, which would > add such additional controls (slider, buttons, etc.) > I looked at ... > Python27\Lib\site-packages\matplotlib\backends\backend_wx.py , but > couldn't find any way to access this windows in custom code. > Would it be possible at all, or are there other options? Is there > maybe some equivalent class/module etc. which could be reused or > adapted? > Or is the only way to reimplement the functionality writing my own > plot gui (or to have the additionally needed controls in a separate > window, which doesn't look very elegant, but could probably work). > > Thanks in advance for any hints > regards > Vlastimil Brom Absolutely! It is one of the things mpl does best. Do a search in the online documentation for "embedding codex". I hope that helps! Ben Root |
From: Vlastimil B. <vla...@gm...> - 2012-07-29 22:14:32
|
Hi all, I'd like to ask about the possibility to eventually reuse the gui of pylab for showing and manipulating the plots in the custom application (written in wxpython). Basically, I'd like to add some application specific controls to the toolbar, or to place the existing gui to a custom frame, which would add such additional controls (slider, buttons, etc.) I looked at ... Python27\Lib\site-packages\matplotlib\backends\backend_wx.py , but couldn't find any way to access this windows in custom code. Would it be possible at all, or are there other options? Is there maybe some equivalent class/module etc. which could be reused or adapted? Or is the only way to reimplement the functionality writing my own plot gui (or to have the additionally needed controls in a separate window, which doesn't look very elegant, but could probably work). Thanks in advance for any hints regards Vlastimil Brom |
From: Eric F. <ef...@ha...> - 2012-07-29 16:31:32
|
On 2012/07/29 5:13 AM, Jeffrey Spencer wrote: > Eric, > > Normalize appears to be working correctly and as you stated above but > when passed into contourf appears to have inconsistent results not > following the docstring by allowing the value to change. > > Quick examples: > > X, Y = meshgrid(arange(20),arange(20)) > Z = arange(20*20) > Z = Z.reshape(20,20) > norm = colors.Normalize(vmin=200,vmax=None) > print norm.vmin > fig = figure(10) > ax = fig.add_subplot(111) > surf = ax.contourf(X,Y,Z, 100, cmap=matplotlib.cm.jet, norm = norm) > > This vmin has no effect where if you pass in: > > X, Y = meshgrid(arange(20),arange(20)) > Z = arange(20*20) > Z = Z.reshape(20,20) > norm = colors.Normalize(vmin=200,vmax=Z.max()) > print norm.vmin > fig = figure(10) > ax = fig.add_subplot(111) > surf = ax.contourf(X,Y,Z, 100, cmap=matplotlib.cm.jet, norm = norm) > > it has the desired effect. > > Let me know if this is correct or I'm missing something here. > > Cheers, > Jeff You are correct. Contour and contourf are respecting vmin, vmax that have been set in the norm only if both have been set, so that it is fully scaled. I think that changing this to respect a single preset vmin or vmax would be reasonable. Eric |
From: Anton A. <ant...@gm...> - 2012-07-29 16:24:22
|
Phil Elson <pelson.pub@...> writes: > > I don't have a good answer to this and have had to implement such a > thing in an outstanding pull request (in my case, I have a figure > which has been un-pickled and needs re-attaching to pyplot). > > My proposed mechanism goes something like: > > figure = matplotlib.figure.Figure(...) > > import matplotlib.pyplot as plt > > mgr = plt._backend_mod.new_figure_manager_given_figure(num, self) > > Obviously this doesn't even exist on master yet, so if you need this > functionality from a version before this you will have to reverse > engineer the pyplot.figure function. Thank you Phil, This would be acceptable, although I cannot say that I'm very happy with the way matplotlib is organized now. Can you point me to a code example where anything like this reverse engineering is done? Thanks, Anton |
From: Phil E. <pel...@gm...> - 2012-07-29 15:43:36
|
I don't have a good answer to this and have had to implement such a thing in an outstanding pull request (in my case, I have a figure which has been un-pickled and needs re-attaching to pyplot). My proposed mechanism goes something like: figure = matplotlib.figure.Figure(...) import matplotlib.pyplot as plt mgr = plt._backend_mod.new_figure_manager_given_figure(num, self) Obviously this doesn't even exist on master yet, so if you need this functionality from a version before this you will have to reverse engineer the pyplot.figure function. HTH, On 29 July 2012 13:12, Anton Akhmerov <ant...@gm...> wrote: > Hi, > > I am writing a module which should, among other things, output images, and it > should work both in interactive mode and when imported as a script. > > In order for the plotting behavior to be clean, I would like to prepare the > figure separate from pyplot. The reason for this, is that the figure is drawn in > a non-interactive loop, and I don't want to show all the steps as they go. > Moreover, for some reason with ipython inline backend the figure is rendered > twice for no obvious reason. So the preferred behavior of my plotting function > (when pyplot output is requested) should be similar to: > > fig = matplotlib.figure.Figure() > ax = fig.add_subplot(111) > ax.plot([1,2,3]) > matplotlib.pyplot.<ADD_FIGURE>(fig) > > The best approximation to this that I was able to find so far is to use the > following dirty hack (although none of the attributes I use are _private!): > > f = plt.figure() > fig.canvas = f.canvas > f.canvas.figure = fig > > However this is still problematic: if the interactive mode is on, then rendering > of the figure will still be called after these two attribute. Moreover in > IPython notebook without inline plotting it will result in an opened GUI window, > but GUI mainloop not running. > > So here's my question: what's the best way to achieve the behavior that I want? > > Thank you, > Anton > > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
From: Jeffrey S. <jef...@gm...> - 2012-07-29 15:14:04
|
Eric, Normalize appears to be working correctly and as you stated above but when passed into contourf appears to have inconsistent results not following the docstring by allowing the value to change. Quick examples: X, Y = meshgrid(arange(20),arange(20)) Z = arange(20*20) Z = Z.reshape(20,20) norm = colors.Normalize(vmin=200,vmax=None) print norm.vmin fig = figure(10) ax = fig.add_subplot(111) surf = ax.contourf(X,Y,Z, 100, cmap=matplotlib.cm.jet, norm = norm) This vmin has no effect where if you pass in: X, Y = meshgrid(arange(20),arange(20)) Z = arange(20*20) Z = Z.reshape(20,20) norm = colors.Normalize(vmin=200,vmax=Z.max()) print norm.vmin fig = figure(10) ax = fig.add_subplot(111) surf = ax.contourf(X,Y,Z, 100, cmap=matplotlib.cm.jet, norm = norm) it has the desired effect. Let me know if this is correct or I'm missing something here. Cheers, Jeff On Mon, Jul 30, 2012 at 12:32 AM, Eric Firing <ef...@ha...> wrote: > On 2012/07/28 10:17 PM, Jeffrey Spencer wrote: > >> Think I figured out an actual bug in the function: colors.Normalize(). >> >> The behavior states that if vmin or vmax is passed in as None it should >> take the minimum or maximum value respectively. >> >> If only one value is passed into the function, both values are >> overwritten to the min and max instead of just the one that is not >> passed in. So the only case where it sets the limits is if both vmin and >> vmax are passed to the function. Is this the desired behavior because >> from the docstring it seems this is incorrect. >> >> Cheers, >> Jeff >> >> >> > Jeff, > > I don't see it, so you need to provide an actual example. Here is what > happens (in ipython --pylab) when I try to reproduce what it sounds like > you are describing: > > In [2]: norm = Normalize(vmax=10) > > In [3]: norm([-10, 10, 20]) > Out[3]: > masked_array(data = [ 0. 1. 1.5], > mask = False, > fill_value = 1e+20) > > > In [4]: norm.vmin > Out[4]: -10.0 > > In [5]: norm.vmax > Out[5]: 10 > > This behavior is as described in the docstring. > > The one potentially confusing aspect that I see at the moment is that the > Normalize class does not distinguish between explicit vmin, vmax, and the > values that it calculates via its autoscale_None method when called. As > soon as a None is replaced by an actual value, whether by being set > explicitly or by autoscaling, the replacement is permanent. Perhaps this > should be made explicit in the docstring. The docstrings could be > re-arranged to clarify the roles of the class initializer and its __call__ > method. > > Eric > > |
From: Eric F. <ef...@ha...> - 2012-07-29 14:32:49
|
On 2012/07/28 10:17 PM, Jeffrey Spencer wrote: > Think I figured out an actual bug in the function: colors.Normalize(). > > The behavior states that if vmin or vmax is passed in as None it should > take the minimum or maximum value respectively. > > If only one value is passed into the function, both values are > overwritten to the min and max instead of just the one that is not > passed in. So the only case where it sets the limits is if both vmin and > vmax are passed to the function. Is this the desired behavior because > from the docstring it seems this is incorrect. > > Cheers, > Jeff > > Jeff, I don't see it, so you need to provide an actual example. Here is what happens (in ipython --pylab) when I try to reproduce what it sounds like you are describing: In [2]: norm = Normalize(vmax=10) In [3]: norm([-10, 10, 20]) Out[3]: masked_array(data = [ 0. 1. 1.5], mask = False, fill_value = 1e+20) In [4]: norm.vmin Out[4]: -10.0 In [5]: norm.vmax Out[5]: 10 This behavior is as described in the docstring. The one potentially confusing aspect that I see at the moment is that the Normalize class does not distinguish between explicit vmin, vmax, and the values that it calculates via its autoscale_None method when called. As soon as a None is replaced by an actual value, whether by being set explicitly or by autoscaling, the replacement is permanent. Perhaps this should be made explicit in the docstring. The docstrings could be re-arranged to clarify the roles of the class initializer and its __call__ method. Eric |
From: Anton A. <ant...@gm...> - 2012-07-29 12:15:16
|
Hi, I am writing a module which should, among other things, output images, and it should work both in interactive mode and when imported as a script. In order for the plotting behavior to be clean, I would like to prepare the figure separate from pyplot. The reason for this, is that the figure is drawn in a non-interactive loop, and I don't want to show all the steps as they go. Moreover, for some reason with ipython inline backend the figure is rendered twice for no obvious reason. So the preferred behavior of my plotting function (when pyplot output is requested) should be similar to: fig = matplotlib.figure.Figure() ax = fig.add_subplot(111) ax.plot([1,2,3]) matplotlib.pyplot.<ADD_FIGURE>(fig) The best approximation to this that I was able to find so far is to use the following dirty hack (although none of the attributes I use are _private!): f = plt.figure() fig.canvas = f.canvas f.canvas.figure = fig However this is still problematic: if the interactive mode is on, then rendering of the figure will still be called after these two attribute. Moreover in IPython notebook without inline plotting it will result in an opened GUI window, but GUI mainloop not running. So here's my question: what's the best way to achieve the behavior that I want? Thank you, Anton |
From: Jeffrey S. <jef...@gm...> - 2012-07-29 08:18:20
|
Think I figured out an actual bug in the function: colors.Normalize(). The behavior states that if vmin or vmax is passed in as None it should take the minimum or maximum value respectively. If only one value is passed into the function, both values are overwritten to the min and max instead of just the one that is not passed in. So the only case where it sets the limits is if both vmin and vmax are passed to the function. Is this the desired behavior because from the docstring it seems this is incorrect. Cheers, Jeff On Sat, Jul 28, 2012 at 2:15 PM, Jeffrey Spencer <jef...@gm...>wrote: > I figured out you can pass in the rasterized keyword to all of those to > change the rasterization in the output. > > Also the docs say for pcolormesh it defaults to the backend if not set. > Therefore, in the case of a vector based it would output vectors if not set > to rasterize. > > Haven't tested but curious. Lets say I want to output at 600dpi but I > display images interactively at 100dpi. Does it always rasterize the image > to the higher dpi? I had noticed this didn't seem to occur in specgram but > figured because the specgram is a relatively low resolution image that > outputing at 600dpi doesn't do anything because original image is already a > low resolution. I would expect the other modes do do this where the image > isn't already output and have to rasterize the image when saving like > pcolormesh and contour plots. > > Cheers, > Jeff > > > On Sat, Jul 28, 2012 at 1:43 PM, Jeffrey Spencer <jef...@gm...>wrote: > >> Yes, specgram rasterizes and contourf is definately a vector >> specification which isn't optimal for 100 levels. >> >> I would switch to pcolormesh but the output file can't be rasterizing the >> image. It outputs a huge file in .pdf (40X bigger than equivalent .png) and >> it looks like it is vector based not rasterized. >> >> >> Basically, If you output specgram or imshow in .pdf or .png the file >> sizes are relatively comparable with .pdf, .eps, .svg being slightly larger >> due to embedding the picture. >> >> If I output in pcolor, pcolormesh, contourf (with more than 100 levels) >> the file sizes are huge for .pdf, .eps, .svg which I'm assuming because >> vector based output. It also looks like vector based output because can see >> the lines it draws for contours. Could this possibly be a selection for >> these outputs to force raster based processing or is that not easy. >> >> >> On Sat, Jul 28, 2012 at 3:26 AM, Eric Firing <ef...@ha...> wrote: >> >>> On 2012/07/26 10:26 PM, Jeffrey Spencer wrote: >>> >>>> Thanks, that is all good info to know. I change my data to log and >>>> normalize it so the logNorm is just linear actually so specifying only >>>> levels is fine. I'll let you know if that doesn't work properly for some >>>> reason. >>>> >>>> Ok, yeah I looked at pcolormesh quickly and can't remember why I chose >>>> originally when I wrote this to go with contourf but I use to only do >>>> like 10 levels. I think it might be because use a log yaxis and think it >>>> used to be a bit funky or couldn't get it working properly but seemed >>>> fine now. >>>> >>>> No, I don't want to modify the ticks but the black lines around that >>>> like how they are removed on the major axis in this example: >>>> https://dl.dropbox.com/u/**13534143/example1.png<https://dl.dropbox.com/u/13534143/example1.png> >>>> I want to remove the black lines also around the colorbar. Not the tick >>>> marks. Does that make sense? >>>> >>> >>> cbar.outline.set_color('none') >>> or >>> cbar.outline.set_visible(**False) >>> >>> >>> >>>> One more quick question out of curiosity noticing from saving plots to >>>> .pdf from contourf and pcolormesh vs specgram. Specgram seems to output >>>> the lines and text as vector graphics. Then imbeds the image. When >>>> outputting from pcolormesh or contourf this isn't the case. It tries to >>>> write the lines or something else weird happens. Can you output to .pdf >>>> from these and make the lines and text be vectors. Then the image output >>>> as an image in the pdf like in specgram. Or is there a setting to do >>>> this and specify the .dpi of the image in the .pdf. >>>> >>> >>> Lines and text are output to pdf exactly the same by specgram, >>> pcolormesh, and contourf. The difference should be only in the image part >>> of the plot, which is rasterized for a specgram image and for the >>> "quadmesh" produced by pcolormesh, but is a set of patches (vector >>> specification, not rasterized) for contourf. Are you seeing results that >>> are inconsistent with this expectation? >>> >>> Eric >>> >>> >>>> Thanks a lot, >>>> Jeff >>>> >>>> On Fri, Jul 27, 2012 at 5:51 PM, Eric Firing <ef...@ha... >>>> <mailto:ef...@ha...>> wrote: >>>> >>>> On 2012/07/26 9:20 PM, Jeffrey Spencer wrote: >>>> >>>> import numpy as np >>>> import matplotlib as mpl >>>> X, Y = np.meshgrid(arange(20),arange(**__20)) >>>> >>>> Z = np.arange(20*20) >>>> Z = Z.reshape(20,20) >>>> logNorm = mpl.colors.Normalize(vmin=0,__**vmax=200) >>>> >>>> fig = mpl.pyplot.figure(10) >>>> ax = fig.add_subplot(111) >>>> surf = ax.contourf(X,Y,Z, 100, cmap=matplotlib.cm.jet, norm = >>>> logNorm) >>>> cbar = fig.colorbar(surf, shrink=0.70, norm=logNorm) >>>> show() >>>> >>>> >>>> >>>> OK, the basic problem here is that you are specifying 100 levels, >>>> which are being auto-selected to cover the actual data range; and >>>> the colorbar is doing what it is supposed to do, which is show the >>>> levels you actually have. Try leaving out the norm, and just >>>> specify the levels to cover what you want, more like this: >>>> >>>> surf = ax.contourf(X, Y, Z, np.arange(0, 200.1, 2), cmap=mpl.cm.jet, >>>> extend='both') >>>> cbar = fig.colorbar(surf, shrink=0.7) >>>> >>>> If you actually do want a log norm, you can pass that in to contourf >>>> and it will be passed on to colorbar; but most likely you should >>>> still specify the levels you want as an array, and not specify vmin >>>> and vmax in the norm. If you want log scaling, it may work better >>>> to simply plot the log of Z, and use the colorbar label to indicate >>>> that this is what you are doing. >>>> >>>> Note that with a recent change, you can use the set_under and >>>> set_over methods of the cmap to specify arbitrary colors, or no >>>> color, for the extended regions; or you can leave out the "extend" >>>> kwarg and not color the regions outside the range of your contour >>>> levels. >>>> >>>> In general, contourf is most appropriate when there is a moderate >>>> number of levels, well under 100; if you want that many gradations, >>>> then you might do better with pcolormesh or ax.pcolorfast or imshow. >>>> For those image-like methods, it is appropriate to use vmin and >>>> vmax, either directly, or in a norm. >>>> >>>> Eric >>>> >>>> >>>> >>> >> > |
From: Alex C. <ac...@ac...> - 2012-07-28 23:15:14
|
Hi matplotlib folks, I am reaching out to various Python-related programming communities in order to offer my help packaging your software. If you have ever struggled with packaging and releasing Python software (e.g. to PyPI), please check out my new service: - http://pythonpackages.com The basic idea is to automate packaging by checking out code, testing, and uploading (e.g. to PyPI) all through the web, as explained in this introduction: - http://docs.pythonpackages.com/en/latest/introduction.html Also, I will be available to answer your Python packaging questions most days/nights in #pythonpackages on irc.freenode.net. Hope to meet/talk with all of you soon. Alex -- Alex Clark · http://pythonpackages.com/ONE_CLICK |
From: elmar w. <el...@ne...> - 2012-07-28 20:25:38
|
Am 28.07.2012 21:46, schrieb Christoph Gohlke: > On 7/28/2012 12:29 PM, elmar werling wrote: >> Hi, >> >> just installed matplotlib by doing >> >> git clone https://github.com/matplotlib/matplotlib >> cd matplotlib >> python3 setup.py build >> sudo python3 setup.py install >> >> When I import matplotlib.pyplot I get the following error message. >> >> Any help is wellcome >> Elmar >> >> >> >> Python 3.2.1 (default, Jul 18 2011, 16:24:40) [GCC] on linux2 >> Type "copyright", "credits" or "license()" for more information. >> >>> import numpy >> >>> import matplotlib >> >>> numpy.__version__ >> '1.6.2' >> >>> matplotlib.__version__ >> '1.2.x' >> >>> import matplotlib.pyplot >> Traceback (most recent call last): >> File "<pyshell#4>", line 1, in <module> >> import matplotlib.pyplot >> File "/usr/local/lib/python3.2/site-packages/matplotlib/pyplot.py", >> line 26, in <module> >> from matplotlib.figure import Figure, figaspect >> File "/usr/local/lib/python3.2/site-packages/matplotlib/figure.py", >> line 19, in <module> >> from .axes import Axes, SubplotBase, subplot_class_factory >> File "/usr/local/lib/python3.2/site-packages/matplotlib/axes.py", >> line 21, in <module> >> import matplotlib.dates as mdates >> File "/usr/local/lib/python3.2/site-packages/matplotlib/dates.py", >> line 122, in <module> >> from dateutil.rrule import rrule, MO, TU, WE, TH, FR, SA, SU, YEARLY, \ >> File "/usr/local/lib/python3.2/site-packages/dateutil/rrule.py", line 55 >> raise ValueError, "Can't create weekday with n == 0" >> ^ >> SyntaxError: invalid syntax >> >>> >> >> >> > > Install python-dateutil 2.1 <http://labix.org/python-dateutil/>. Do not > use not dateutil 1.5 or the version included with matplotlib. > > See also <https://github.com/matplotlib/matplotlib/issues/983> > > Christoph > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > thank you, will test it tommorow, first i have to install setuptools |
From: Christoph G. <cg...@uc...> - 2012-07-28 19:46:53
|
On 7/28/2012 12:29 PM, elmar werling wrote: > Hi, > > just installed matplotlib by doing > > git clone https://github.com/matplotlib/matplotlib > cd matplotlib > python3 setup.py build > sudo python3 setup.py install > > When I import matplotlib.pyplot I get the following error message. > > Any help is wellcome > Elmar > > > > Python 3.2.1 (default, Jul 18 2011, 16:24:40) [GCC] on linux2 > Type "copyright", "credits" or "license()" for more information. > >>> import numpy > >>> import matplotlib > >>> numpy.__version__ > '1.6.2' > >>> matplotlib.__version__ > '1.2.x' > >>> import matplotlib.pyplot > Traceback (most recent call last): > File "<pyshell#4>", line 1, in <module> > import matplotlib.pyplot > File "/usr/local/lib/python3.2/site-packages/matplotlib/pyplot.py", > line 26, in <module> > from matplotlib.figure import Figure, figaspect > File "/usr/local/lib/python3.2/site-packages/matplotlib/figure.py", > line 19, in <module> > from .axes import Axes, SubplotBase, subplot_class_factory > File "/usr/local/lib/python3.2/site-packages/matplotlib/axes.py", > line 21, in <module> > import matplotlib.dates as mdates > File "/usr/local/lib/python3.2/site-packages/matplotlib/dates.py", > line 122, in <module> > from dateutil.rrule import rrule, MO, TU, WE, TH, FR, SA, SU, YEARLY, \ > File "/usr/local/lib/python3.2/site-packages/dateutil/rrule.py", line 55 > raise ValueError, "Can't create weekday with n == 0" > ^ > SyntaxError: invalid syntax > >>> > > > Install python-dateutil 2.1 <http://labix.org/python-dateutil/>. Do not use not dateutil 1.5 or the version included with matplotlib. See also <https://github.com/matplotlib/matplotlib/issues/983> Christoph |
From: elmar w. <el...@ne...> - 2012-07-28 19:29:59
|
Hi, just installed matplotlib by doing git clone https://github.com/matplotlib/matplotlib cd matplotlib python3 setup.py build sudo python3 setup.py install When I import matplotlib.pyplot I get the following error message. Any help is wellcome Elmar Python 3.2.1 (default, Jul 18 2011, 16:24:40) [GCC] on linux2 Type "copyright", "credits" or "license()" for more information. >>> import numpy >>> import matplotlib >>> numpy.__version__ '1.6.2' >>> matplotlib.__version__ '1.2.x' >>> import matplotlib.pyplot Traceback (most recent call last): File "<pyshell#4>", line 1, in <module> import matplotlib.pyplot File "/usr/local/lib/python3.2/site-packages/matplotlib/pyplot.py", line 26, in <module> from matplotlib.figure import Figure, figaspect File "/usr/local/lib/python3.2/site-packages/matplotlib/figure.py", line 19, in <module> from .axes import Axes, SubplotBase, subplot_class_factory File "/usr/local/lib/python3.2/site-packages/matplotlib/axes.py", line 21, in <module> import matplotlib.dates as mdates File "/usr/local/lib/python3.2/site-packages/matplotlib/dates.py", line 122, in <module> from dateutil.rrule import rrule, MO, TU, WE, TH, FR, SA, SU, YEARLY, \ File "/usr/local/lib/python3.2/site-packages/dateutil/rrule.py", line 55 raise ValueError, "Can't create weekday with n == 0" ^ SyntaxError: invalid syntax >>> |