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
(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 F. <ef...@ha...> - 2012-04-09 19:31:25
|
On 04/09/2012 08:17 AM, Mathew Topper wrote: > Hi Eric, thanks for the tip about the legend. > > Regarding the data, assuming i am using pcolor, am I right in thinking > that using Boundarynorm would be the best way to control the colors for > each code? Mat, I think BoundaryNorm is overkill and/or awkward for your case. It sounds like you don't have ordinary values, but rather a set of labels that happen to be integers. I would use a ListedColormap and then use sequential integers as the C values to index directly into the colormap: C = np.array([[0,1,2],[2,0,1]]) import matplotlib.colors as mcolors cmap = mcolors.ListedColormap(['r', 'g', 'lightgray']) pcolor(C, cmap=cmap, norm=mcolors.NoNorm()) Of course you would need to map your sequence of numbers (-8888, 0, ...) to a sequence of integers starting at zero. The key point is that the NoNorm() instance leaves your original C values alone, and since they are integers, they are then used directly as indices. You could also make your own mcolors.Normalize subclass which would process your labels and return either a float in the 0-1 range, or an integer for direct indexing. When you need only a very few colors, the ListedColormap with direct indexing is nice because it allows you to specify those colors using any valid color specification method. Eric > > Thanks > > Mat > > On 04/09/2012 06:26 PM, Eric Firing wrote: >> On 04/09/2012 02:22 AM, Mathew Topper wrote: >>> Dear matplotlib-users, >>> >>> I have a spatial data set that has coded values for each cell, which are >>> limited to just a few numbers, ie -8888, 0, 100, and 9999. I would like >>> to display this data with a plot similar to pcolor, but I don't want a >>> colorbar, I want a legend showing the colors for each code and an >>> explanation for what each code represents. I would like to be able to >>> choose a subset of the codes as well, for example just plotting the 0 >>> and 100 codes and ignoring the -8888 and 9999 codes. >>> >>> I have seen a few similar attempts that used BoundaryNorm, but I don't >>> want to show a range of values I just want to set colors for a few >>> explicit values. Those examples also had a colorbar and, as I said, I >>> would prefer a legend. >>> >>> Can anyone offer any tips? >> For the plot itself you can use pcolor if your data are on a >> quadrilateral grid, or a PathCollection or PolyCollection otherwise. >> For the legend, you can use proxy artists: >> >> http://matplotlib.sourceforge.net/users/legend_guide.html#using-proxy-artist >> >> Eric >> >>> Thanks >>> >>> Mat >>> >> >> ------------------------------------------------------------------------------ >> For Developers, A Lot Can Happen In A Second. >> Boundary is the first to Know...and Tell You. >> Monitor Your Applications in Ultra-Fine Resolution. Try it FREE! >> http://p.sf.net/sfu/Boundary-d2dvs2 >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> > > -- > Dr. Mathew Topper > Institute for Energy Systems > School of Engineering > The University of Edinburgh > Faraday Building > The King’s Buildings > Edinburgh EH9 3JL > Tel: +44 (0)131 650 5570 > School fax: +44 (0)131 650 6554 > mat...@ed... <mailto:mat...@ed...> > http://www.see.ed.ac.uk <http://www.see.ed.ac.uk/> > > > > The University of Edinburgh is a charitable body, registered in > Scotland, with registration number SC005336. > > > > ------------------------------------------------------------------------------ > For Developers, A Lot Can Happen In A Second. > Boundary is the first to Know...and Tell You. > Monitor Your Applications in Ultra-Fine Resolution. Try it FREE! > http://p.sf.net/sfu/Boundary-d2dvs2 > > > > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
From: Mathew T. <mat...@ed...> - 2012-04-09 18:17:29
|
The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. |
From: Eric F. <ef...@ha...> - 2012-04-09 17:27:08
|
On 04/09/2012 02:22 AM, Mathew Topper wrote: > Dear matplotlib-users, > > I have a spatial data set that has coded values for each cell, which are > limited to just a few numbers, ie -8888, 0, 100, and 9999. I would like > to display this data with a plot similar to pcolor, but I don't want a > colorbar, I want a legend showing the colors for each code and an > explanation for what each code represents. I would like to be able to > choose a subset of the codes as well, for example just plotting the 0 > and 100 codes and ignoring the -8888 and 9999 codes. > > I have seen a few similar attempts that used BoundaryNorm, but I don't > want to show a range of values I just want to set colors for a few > explicit values. Those examples also had a colorbar and, as I said, I > would prefer a legend. > > Can anyone offer any tips? For the plot itself you can use pcolor if your data are on a quadrilateral grid, or a PathCollection or PolyCollection otherwise. For the legend, you can use proxy artists: http://matplotlib.sourceforge.net/users/legend_guide.html#using-proxy-artist Eric > > Thanks > > Mat > |
From: Jouni K. S. <jk...@ik...> - 2012-04-09 12:38:43
|
Benjamin Root <ben...@ou...> writes: >> sanders <sa...@kn...> writes: >> >> > If keywords fill=False and log=True, >> > >> > then after saving, the png looks fine but the histogram in the pdf is >> > mixed up. >> >> Confirmed, thanks for the report. I filed this at >> https://github.com/matplotlib/matplotlib/issues/804 > > I ran into something like this with filled plots originally saved as eps > files and then converted into a pdf. Didn't need log=True, though. I think that's likely a different issue. The eps output machinery in matplotlib is somewhat complicated, which it likely has to be to function well with various eps-handling software, and incorporate LaTeX-rendered equations. With all the various steps (including distilling through an external program) it's difficult to debug what goes wrong. In the original problem, it seems that the path-cropping functionality used in logarithmic plots is outputting paths that work in Agg but not in pdf or svg. It basically rewrites moveto X0,Y0 (outside plottable area) lineto X1,Y0 (outside plottable area) lineto X1,Y1 (inside) lineto X0,Y1 (inside) closepath into moveto X0,Y0' (Y0' is Y0 rewritten to be close to the area) moveto X1,Y0' lineto X1,Y1 lineto X0,Y1 closepath and the closepath operation apparently goes to the first moveto in Agg, but to the latest moveto in pdf and svg. I have a suggested fix for this at https://github.com/matplotlib/matplotlib/pull/817 -- Jouni K. Seppänen http://www.iki.fi/jks |
From: Mathew T. <mat...@ed...> - 2012-04-09 12:22:36
|
Dear matplotlib-users, I have a spatial data set that has coded values for each cell, which are limited to just a few numbers, ie -8888, 0, 100, and 9999. I would like to display this data with a plot similar to pcolor, but I don't want a colorbar, I want a legend showing the colors for each code and an explanation for what each code represents. I would like to be able to choose a subset of the codes as well, for example just plotting the 0 and 100 codes and ignoring the -8888 and 9999 codes. I have seen a few similar attempts that used BoundaryNorm, but I don't want to show a range of values I just want to set colors for a few explicit values. Those examples also had a colorbar and, as I said, I would prefer a legend. Can anyone offer any tips? Thanks Mat -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. |
From: Francesco O. <fra...@gm...> - 2012-04-07 10:39:40
|
Hi Guillaume , actually the "loop" version fits better with my requirements. Thanks, Francesco Il 07/04/2012 12:28, Guillaume Gay ha scritto: > Hi Fransesco, > > This is possible indeed, from the doc: > http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.plot: > you can do this: > a.plot(x1, y1, 'g^', x2, y2, 'g-') > > But I would rather set up a loop: > > > for file in sys.arv[1:]: > ... > #read your data > .... > plt.plot(xn,yn) > > Hope this helps. > > Guillaume > > > Le 07/04/2012 10:36, Francesco Oteri a écrit : >> Dear Matplotlib users, >> I am trying to write a script that read a variable number of data set like: >> >> script.py set0.dat set1.dat ..... setN.dat >> >> The problem rise in the method plt.plot() because I don't know how >> manage a variable number of argument. >> I am wondering wether exists something like: >> >> plt.plot([ (x0,y0,"g-"),(x1,y1,"b-"),...,(xN,yN,"b-")] >> >> >> Francesco >> >> >> >> ------------------------------------------------------------------------------ >> For Developers, A Lot Can Happen In A Second. >> Boundary is the first to Know...and Tell You. >> Monitor Your Applications in Ultra-Fine Resolution. Try it FREE! >> http://p.sf.net/sfu/Boundary-d2dvs2 >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> > > > > ------------------------------------------------------------------------------ > For Developers, A Lot Can Happen In A Second. > Boundary is the first to Know...and Tell You. > Monitor Your Applications in Ultra-Fine Resolution. Try it FREE! > http://p.sf.net/sfu/Boundary-d2dvs2 > > > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
From: Francesco O. <fra...@gm...> - 2012-04-07 08:36:27
|
Dear Matplotlib users, I am trying to write a script that read a variable number of data set like: script.py set0.dat set1.dat ..... setN.dat The problem rise in the method plt.plot() because I don't know how manage a variable number of argument. I am wondering wether exists something like: plt.plot([ (x0,y0,"g-"),(x1,y1,"b-"),...,(xN,yN,"b-")] Francesco |
From: klo uo <kl...@gm...> - 2012-04-06 14:40:31
|
On Thu, Apr 5, 2012 at 3:53 AM, Benjamin Root <ben...@ou...> wrote: > > With the way matplotlib is designed and structured, it may be a while > before that would be possible. It wouldn't be impossible, mind you, but I > just haven't thought about that. Could you file a wishlist item on > Github? Maybe I could steal some code from Mayavi for this idea... > > In the meantime, Mayavi would be your best bet, though. > Yes, Mayavi seem very nice for 3D and also runs very smooth I would expect that exporting is available by underlying VTK, but don't know I opened issue anyway, as suggested: https://github.com/matplotlib/matplotlib/issues/816 Cheers |
From: Russell E. O. <ro...@uw...> - 2012-04-05 23:32:13
|
In article <CA65B53A.23941%wcc...@lb...>, Bill Carithers <wcc...@lb...> wrote: > Hi all, > > I had matplotlib-0.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 matplotlib-1.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 pre-installed. I tried > re-installing numpy but that didn¹t help so now I¹m stuck. > > Any suggestions? I personally would not try to mess with Apple's python. It's safer to leave it alone, and it is not upgrade very often. My personal favorite option: - install python.org's python - install the official binary installers for numpy and matplotlib (both of which assume python.org's python) You can use other standard distributions of Python including: - fink - MacPorts - Enthought's python distribution most or all of these come with their own versions of numpy and matplotlib (though in the case of fink and MacPorts you have to explicitly install them). -- Russell |
From: Emmanuel M. <ema...@ya...> - 2012-04-05 17:17:30
|
The navigation toolbar is ugly ;-) I would like to change the icons, let's say for the 'home' position. How can I do that? -- E |
From: Moore, E. (NIH/N. [F] <eri...@ni...> - 2012-04-05 13:51:48
|
> -----Original Message----- > From: Marston Johnston [mailto:she...@gm...] > Sent: Thursday, April 05, 2012 9:11 AM > To: mat...@li... > Subject: Re: [Matplotlib-users] 3D layered plot > > Hi Eric, > > For some reason I cannot see your post on the webpage but I get your > emails. > My python doesn't have: art3d.poly_collection_2d_to_3d() > Is this an old function that has been deprecated? I'm using matplotlib > version 1.1.0 > > /M > I'm also running matplotlib version 1.1.0. Perhaps someone else can comment, but as far as I know poly_collection_2d_to_3d is part of version 1.1.0. How does it fail when you try to run the example I gave? Can you import mpl_toolkits.mplot3d.art3d? |
From: Hong Xu <xu...@gm...> - 2012-04-05 13:33:42
|
Hello, This function <http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.plotfile>, matplotlib.pyplot.plotfile, seems cannot plot from an ASCII table from stdin. Is there anyway to add this feature? In addition, is there any command line interface for this function available? Thanks! Hong |
From: Marston J. <she...@gm...> - 2012-04-05 13:10:42
|
Hi Eric, For some reason I cannot see your post on the webpage but I get your emails. My python doesn't have: art3d.poly_collection_2d_to_3d() Is this an old function that has been deprecated? I'm using matplotlib version 1.1.0 /M On Apr 5, 2012, at 10:47 AM, Marston wrote: > > This plot is possible in MATLAB but I would like to do this in matplotlib. > See attached fig. > In matlab the code is: > > a=peaks(20); > b=peaks(20)+2*rand(20); > c=rand(20); > figure; hold on; > ha=pcolor(a); > hb=pcolor(b); > hc=pcolor(c); > set(hb,'zdata',0*b+5) > set(hc,'zdata',0*c+10) > > This plot can then be rotated, as is done in the figure, to what I want to > accomplish in matplotlib. > http://old.nabble.com/file/p33568798/set_matlab_image.jpg > set_matlab_image.jpg > > Is this possible, if so, how? > > -- > View this message in context: http://old.nabble.com/3D-layered-plot-tp33568798p33568798.html > Sent from the matplotlib - users mailing list archive at Nabble.com. > > > ------------------------------------------------------------------------------ > Better than sec? Nothing is better than sec when it comes to > monitoring Big Data applications. Try Boundary one-second > resolution app monitoring today. Free. > http://p.sf.net/sfu/Boundary-dev2dev > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
From: Moore, E. (NIH/N. [F] <eri...@ni...> - 2012-04-05 12:32:36
|
It sort of is: import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D import mpl_toolkits.mplot3d.art3d as art3d import numpy as np x, y = np.mgrid[0:2*np.pi:16j, 0:2*np.pi:16j] C = np.cos(2*x[:-1,:-1]) + np.sin(y[:-1,:-1]) fig = plt.figure() ax = fig.add_subplot(111, projection='3d') p = ax.pcolor(x, y, C) art3d.poly_collection_2d_to_3d(p, 0) q = ax.pcolor(x, y, C) art3d.poly_collection_2d_to_3d(q, 5) o = ax.pcolor(x, y, C) art3d.poly_collection_2d_to_3d(o, 10) ax.set_xlim([x[0,0], x[-1,0]]) ax.set_ylim([y[0,0], y[0,-1]]) ax.set_zlim([0,10]) plt.show() -Eric > -----Original Message----- > From: Marston [mailto:she...@gm...] > Sent: Thursday, April 05, 2012 4:48 AM > To: mat...@li... > Subject: [Matplotlib-users] 3D layered plot > > > This plot is possible in MATLAB but I would like to do this in > matplotlib. > See attached fig. > In matlab the code is: > > a=peaks(20); > b=peaks(20)+2*rand(20); > c=rand(20); > figure; hold on; > ha=pcolor(a); > hb=pcolor(b); > hc=pcolor(c); > set(hb,'zdata',0*b+5) > set(hc,'zdata',0*c+10) > > This plot can then be rotated, as is done in the figure, to what I want > to > accomplish in matplotlib. > http://old.nabble.com/file/p33568798/set_matlab_image.jpg > set_matlab_image.jpg > > Is this possible, if so, how? > > -- > View this message in context: http://old.nabble.com/3D-layered-plot- > tp33568798p33568798.html > Sent from the matplotlib - users mailing list archive at Nabble.com. > > > ----------------------------------------------------------------------- > ------- > Better than sec? Nothing is better than sec when it comes to > monitoring Big Data applications. Try Boundary one-second > resolution app monitoring today. Free. > http://p.sf.net/sfu/Boundary-dev2dev > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
From: Marston <she...@gm...> - 2012-04-05 08:47:47
|
This plot is possible in MATLAB but I would like to do this in matplotlib. See attached fig. In matlab the code is: a=peaks(20); b=peaks(20)+2*rand(20); c=rand(20); figure; hold on; ha=pcolor(a); hb=pcolor(b); hc=pcolor(c); set(hb,'zdata',0*b+5) set(hc,'zdata',0*c+10) This plot can then be rotated, as is done in the figure, to what I want to accomplish in matplotlib. http://old.nabble.com/file/p33568798/set_matlab_image.jpg set_matlab_image.jpg Is this possible, if so, how? -- View this message in context: http://old.nabble.com/3D-layered-plot-tp33568798p33568798.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
From: Marston <she...@gm...> - 2012-04-05 08:40:05
|
I solved this problem using pyplot and the following code: x = np.arange(22) y = x window = 1 tsize = 8 plt.clf() plt.cla() nrow = 0 for k in np.sort(dlist.keys()): # 2d data arrays of size (x,y) if not doplot[k]: continue vdic = dlist[k] for v in np.sort(vdic.keys()): plt.subplot(self.rows,self.cols,window) if vlist[k] == 'RR': plt.title(v,fontsize=tsize) plt.subplots_adjust(bottom=0.26,left=0.18, # These values are taken from the GUI right=.90, top=0.94, # window after I adjusted the fig to my liking wspace=0.07,hspace=0.94) cs = plt.contourf(x,y,vdic[v],levels[k],cmap= cm.get_cmap('jet',len(levels[k])-1)) plt.axis('off') window += 1 ax = plt.gca() pos = ax.get_position() l,b,w,h = pos.bounds print l,b,w,h cax = plt.axes([l-0.668,b-0.02,0.719,0.01]) # setup colorbar axes cbar = plt.colorbar(cs,cax=cax,orientation='horizontal') cl = plt.getp(cbar.ax, 'xticklabels') plt.setp(cl, fontsize=8) fx = 0.07 fy = 0.9 dy = 0.15 yp = fy - (dy*nrow) plt.figtext(fx,yp,units[k],fontsize=tsize+1) nrow += 1 #pdb.set_trace() # debugging python -m file.py cmd = '%s%s%s' % ('ece3_',win,'_L91.pdf') plt.savefig(cmd,dpi=600,orientation='landscape') I also attached an example. 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: > > http://old.nabble.com/file/p33544950/fig.jpg fig.jpg > > 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. > -- View this message in context: http://old.nabble.com/Subplot-array-and-colorbar-tp33544950p33568733.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
From: Benjamin R. <ben...@ou...> - 2012-04-05 02:02:18
|
On Wed, Mar 28, 2012 at 2:27 PM, Jouni K. Seppänen <jk...@ik...> wrote: > sanders <sa...@kn...> writes: > > > If keywords fill=False and log=True, > > > > then after saving, the png looks fine but the histogram in the pdf is > > mixed up. > > Confirmed, thanks for the report. I filed this at > https://github.com/matplotlib/matplotlib/issues/804 > > I ran into something like this with filled plots originally saved as eps files and then converted into a pdf. Didn't need log=True, though. The eps files were fine, but depending on how I converted (pstopdf or ps2pdf, I forget which) it would get messed up. I will double-check my comments I made in a Makefile about this to see if it might be related. Ben Root |
From: Benjamin R. <ben...@ou...> - 2012-04-05 01:54:21
|
On Tue, Mar 27, 2012 at 5:39 PM, klo uo <kl...@gm...> wrote: > Ah mayavi... I find it complicated for building, and in Ubuntu repository > (or launchpad) there is some old version > I'll try later today to build it > > Thanks for your suggestion, > Cheers > > > > On Tue, Mar 27, 2012 at 11:25 PM, Frédéric Vogt <fv...@ms...>wrote: > >> Is the savefig function what you're looking for ? >> >> http://github.enthought.com/mayavi/mayavi/auto/mlab_figure.html >> >> Note that as far as I know, the .mtl file associated with a given .obj >> file is not handled properly - all your colors will be white. Personally, I >> export in .vrml which suits my needs better, as it does handle colors in a >> satisfactory way. >> >> > With the way matplotlib is designed and structured, it may be a while before that would be possible. It wouldn't be impossible, mind you, but I just haven't thought about that. Could you file a wishlist item on Github? Maybe I could steal some code from Mayavi for this idea... In the meantime, Mayavi would be your best bet, though. Thanks, Ben Root |
From: Emmanuel M. <ema...@ya...> - 2012-04-04 18:43:00
|
After trying hard to send a plot to my widget, I finally found a solution that works: get the figure from the widget! In short, it is has simple as: from pyqtgraph.Qt import QtGui, QtCore import matplotlib from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas from matplotlib.backends.backend_qt4agg import NavigationToolbar2QTAgg as NavigationToolbar from matplotlib.figure import Figure class MatplotlibWidget(QtGui.QWidget): """ Implements a Matplotlib figure inside a QWidget. Use getFigure() and redraw() to interact with matplotlib. Example:: mw = MatplotlibWidget() subplot = mw.getFigure().add_subplot(111) subplot.plot(x,y) mw.draw() """ def __init__(self, size=(5.0, 4.0), dpi=100): QtGui.QWidget.__init__(self) self.fig = Figure(size, dpi=dpi) self.canvas = FigureCanvas(self.fig) self.canvas.setParent(self) self.toolbar = NavigationToolbar(self.canvas, self) self.vbox = QtGui.QVBoxLayout() self.vbox.addWidget(self.toolbar) self.vbox.addWidget(self.canvas) self.setLayout(self.vbox) def getFigure(self): return self.fig def draw(self): self.canvas.draw() A special thanks to the pyqtgraph maintainer http://luke.campagnola.me/code/pyqtgraph/ ________________________________ From: Emmanuel Mayssat <ema...@ya...> To: Emmanuel Mayssat <ema...@ya...>; Eric Firing <ef...@ha...>; "mat...@li..." <mat...@li...> Sent: Tuesday, April 3, 2012 4:36 PM Subject: Re: [Matplotlib-users] assigning a plot object to a figure Although this work, I lose the position of the axes. How can I reposition the axes2 which was at 221 in fig2, to 221 in fig1 ? ________________________________ From: Emmanuel Mayssat <ema...@ya...> To: Eric Firing <ef...@ha...>; "mat...@li..." <mat...@li...> Sent: Monday, April 2, 2012 3:20 PM Subject: Re: [Matplotlib-users] assigning a plot object to a figure Well, not sure if that is supported, but I found a way !: [...] self.fig1 = Figure(figsize=(width, height), dpi=dpi) self.fig2 = Figure(figsize=(width, height), dpi=dpi) self.axes1 = self.fig1.add_subplot(223) self.axes2 = self.fig2.add_subplot(221) [...] self.axes2.plot([0,1]) (1) self.axes2.set_figure(self.fig1) (2) self.fig1.add_axes(self.axes2) Note that (1) and (2) are required in that order! From the code above, if I show the fig1, then I see axes1 and axes2 on the figure.... Summary: I created the axes2 independently of fig1 PS: I want to use my axes2 as an object to sent to my Qt widget (a blank figure/canvas) -- Emmanuel ________________________________ From: Eric Firing <ef...@ha...> To: mat...@li... Sent: Sunday, April 1, 2012 1:36 PM Subject: Re: [Matplotlib-users] assigning a plot object to a figure 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 ------------------------------------------------------------------------------ This SF email is sponsosred by: Try Windows Azure free for 90 days Click Here http://p.sf.net/sfu/sfd2d-msazure _______________________________________________ Matplotlib-users mailing list Mat...@li... https://lists.sourceforge.net/lists/listinfo/matplotlib-users ------------------------------------------------------------------------------ Better than sec? Nothing is better than sec when it comes to monitoring Big Data applications. Try Boundary one-second resolution app monitoring today. Free. http://p.sf.net/sfu/Boundary-dev2dev _______________________________________________ Matplotlib-users mailing list Mat...@li... https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
From: Magician <f_m...@ma...> - 2012-04-04 16:57:15
|
Thanks again, Eric. I had been trying, and finally got a good result. My answer is installing PyQt4 for newer Python (v2.7.2) from sources. Here is the successful steps: 1. Install SIP from source (sip-4.13.2.tar.gz) at default directory 2. Install QtSDK from .run file (Qt_SDK_Lin64_online_v1_2_en.run) at /usr/local/QtSDK * To install Qt from source, we have to get additional libraries. It was very bothersome, so I used official .run file. 3. Install PyQt4 from source (PyQt-x11-gpl-4.9.1.tar.gz) When I did ./configure, I set these options: python ./configure.py -g -q /usr/local/QtSDK/Desktop/Qt/4.8.0/gcc/bin/qmake If not setting -q option, pre-installed Qt may be selected, and we may get DBusPendingCall errors. After above, I set backend and plotted line as below: > import matplotlib > matplotlib.use("Qt4Agg") > import matplotlib.pyplot as plt > plt.plot([1,2,4,3]) > plt.show() Then I got plot window from PyQt4! :) Magician On 2012/04/01, at 19:42, mat...@li... wrote: > Date: Sat, 31 Mar 2012 07:53:21 -1000 > From: Eric Firing <ef...@ha...> > Subject: Re: [Matplotlib-users] Display problem on CentOS > To: mat...@li... > Message-ID: <4F7...@ha...> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > On 03/31/2012 04:02 AM, Magician wrote: >> Alexis& Eric >> >> >> Thanks for your advices. >> I've been trying, but I still have some problems. >> >> I tried matplotlib.matplotlib_fname() and I found my silly mistake. >> Python answered '/usr/local/lib/python2.7/site-packages/matplotlib/mpl-data/matplotlibrc' >> My RC file was named ".matplotlibrc". >> When the prefixed dot removed, it works perfectly. >> >> And I found to change the backends by using matplotlib.use() command. >> I tried all of them, but nothing worked (with errors). >> >> When using matplotlib.get_backend() on pre-installed python2.6, >> it said 'GTKAgg' and matplotlib.pyplot.show() exactly worked. >> So I tried to install PyGTK from source code, but it's fairly complicated. >> >> Is there an easy way to install backends for additionally installed Python? >> My python is v2.7.2. > > Can you find CentOS packages for any of the gui toolkits for your python > version? pygtk, pyqt4, tkinter, wxpython--any of them? If so, you > should be just about set. Only pygtk and tkinter would even require > rebuilding mpl; pyqt4 and wxpython don't require any mpl extension code. > > Eric > >> >> >> Magician >> >> >> On 2012/03/27, at 23:04, Alexis Praga wrote: >> >>> You can check you are editing the correct configuration file with (in >>> the Python shell) : >>>>>> import matplotlib >>>>>> matplotlib.matplotlib_fname() >>> >>> You can also try other backends. For a list, see : >>> http://matplotlib.sourceforge.net/faq/usage_faq.html#what-is-a-backend >>> >>> On Tue, Mar 27, 2012 at 2:46 PM, Magician<f_m...@ma...> wrote: >>>> Thank you, Alexis. >>>> >>>> I try to install PyQt4 and set Qt4Agg just now, but nothing displayed. >>>> Ummm...what's wrong...?? >>>> >>>> >>>> Magician >>>> >>>> >>>> On 2012/03/27, at 17:05, Alexis Praga wrote: >>>> >>>>> I had the same problem on Debian. >>>>> Editing the matplotlibrc (should be installed somewhere in your >>>>> systeme) and changing the "backend" variable to Qt4Agg did the trick. >>>>> >>>>> >>>>> >>>>> On Tue, Mar 27, 2012 at 12:14 AM, Magician<f_m...@ma...> wrote: >>>>>> Hi. >>>>>> >>>>>> I want to install Matplotlib from source code on CentOS. >>>>>> I've been using Matplotlib for a year. >>>>>> But this is the first time for me to install CentOS by myself. >>>>>> >>>>>> I installed CentOS 6.2 in basic install option. >>>>>> Next, I installed NumPy and Matplotlib. >>>>>> .matplotlibrc isn't set. >>>>>> >>>>>> It looks successfully installed, but when I type show() command, >>>>>> nothing appears. >>>>>> I can export PNG image by using savefig() command, so maybe >>>>>> I'm using invalid backend. >>>>>> >>>>>> How can I display plots with show() command? >>>>>> >>>>>> >>>>>> Magician |
From: Benjamin R. <ben...@ou...> - 2012-04-04 16:21:09
|
On Wednesday, April 4, 2012, Nikolaus Rath wrote: > Hello, > > I'm plotting a rotating phase: > > # ipython --pylab > x1 = linspace(0, 2*pi, 30) > x = concatenate((x1,x1,x1,x1)) > plot(x) > > The resulting plot has ugly vertical lines whenever x wraps from 2*pi > back to zero. > > Does someone have a nice, general way to get to get rid of such lines? > > (the actual data is of course less predictable and regular than the > example above). > > > Best, > > -Nikolaus > > Put [np.nan] between each complete rotation. Nans in a plot breaks the line. Ben Root |
From: Warren W. <war...@en...> - 2012-04-04 16:20:46
|
Forwarding an email that I sent directly to Nikolaus. (I think every other mailing list that I used defaults to something like "Reply to list" or "Reply to all".) Warren ---------- Forwarded message ---------- From: Warren Weckesser <war...@en...> Date: Wed, Apr 4, 2012 at 11:18 AM Subject: Re: [Matplotlib-users] How to remove vertical lines when plotting rotating phase To: Nikolaus Rath <Nik...@ra...> On Wed, Apr 4, 2012 at 10:48 AM, Warren Weckesser < war...@en...> wrote: > > > On Wed, Apr 4, 2012 at 10:30 AM, Nikolaus Rath <Nik...@ra...> wrote: > >> Hello, >> >> I'm plotting a rotating phase: >> >> # ipython --pylab >> x1 = linspace(0, 2*pi, 30) >> x = concatenate((x1,x1,x1,x1)) >> plot(x) >> >> The resulting plot has ugly vertical lines whenever x wraps from 2*pi >> back to zero. >> >> Does someone have a nice, general way to get to get rid of such lines? >> >> (the actual data is of course less predictable and regular than the >> example above). >> >> >> > > You can use numpy.unwrap, e.g. > > plot(unwrap(x)) > > > Warren > > You might not want the "unwrapped" effect. You can figure out where the "big" jumps occur, and plot the data in pieces with something like this example. It doesn't plot lines that jump by more than pi: ----- import numpy as np import matplotlib.pyplot as plt t = np.linspace(0, 10, 200) y = np.mod(2 * t * np.sin(0.5 * t), 2 * np.pi) jumps = np.r_[0, np.where(np.abs(np.diff(y)) > np.pi)[0] + 1, y.size] for k in range(jumps.size-1): start, end = jumps[k:k + 2] plt.plot(t[start:end], y[start:end], 'b') plt.show() ----- I don't know if something like this already exists in matplotlib, or if there is some other technique that would be simpler. Warren |
From: Nikolaus R. <Nik...@ra...> - 2012-04-04 15:30:27
|
Hello, I'm plotting a rotating phase: # ipython --pylab x1 = linspace(0, 2*pi, 30) x = concatenate((x1,x1,x1,x1)) plot(x) The resulting plot has ugly vertical lines whenever x wraps from 2*pi back to zero. Does someone have a nice, general way to get to get rid of such lines? (the actual data is of course less predictable and regular than the example above). Best, -Nikolaus -- »Time flies like an arrow, fruit flies like a Banana.« PGP fingerprint: 5B93 61F8 4EA2 E279 ABF6 02CF A9AD B7F8 AE4E 425C |
From: Ben H. <ben...@li...> - 2012-04-04 00:57:26
|
I create my figure in my (non-interactive) script like so: import matplotlib.pyplot as plt fig = plt.figure() ax = fig.add_subplot(111) ax.plot(...) Then I want to set the spacing of y grid to 50 units (axis units). Do I need a method of the matplotlib.axis.Axis, or matplotlib.axes.Axes (or are these the same??), or something else? Ben. |
From: Emmanuel M. <ema...@ya...> - 2012-04-03 23:37:06
|
Although this work, I lose the position of the axes. How can I reposition the axes2 which was at 221 in fig2, to 221 in fig1 ? ________________________________ From: Emmanuel Mayssat <ema...@ya...> To: Eric Firing <ef...@ha...>; "mat...@li..." <mat...@li...> Sent: Monday, April 2, 2012 3:20 PM Subject: Re: [Matplotlib-users] assigning a plot object to a figure Well, not sure if that is supported, but I found a way !: [...] self.fig1 = Figure(figsize=(width, height), dpi=dpi) self.fig2 = Figure(figsize=(width, height), dpi=dpi) self.axes1 = self.fig1.add_subplot(223) self.axes2 = self.fig2.add_subplot(221) [...] self.axes2.plot([0,1]) (1) self.axes2.set_figure(self.fig1) (2) self.fig1.add_axes(self.axes2) Note that (1) and (2) are required in that order! From the code above, if I show the fig1, then I see axes1 and axes2 on the figure.... Summary: I created the axes2 independently of fig1 PS: I want to use my axes2 as an object to sent to my Qt widget (a blank figure/canvas) -- Emmanuel ________________________________ From: Eric Firing <ef...@ha...> To: mat...@li... Sent: Sunday, April 1, 2012 1:36 PM Subject: Re: [Matplotlib-users] assigning a plot object to a figure 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 ------------------------------------------------------------------------------ This SF email is sponsosred by: Try Windows Azure free for 90 days Click Here http://p.sf.net/sfu/sfd2d-msazure _______________________________________________ Matplotlib-users mailing list Mat...@li... https://lists.sourceforge.net/lists/listinfo/matplotlib-users ------------------------------------------------------------------------------ Better than sec? Nothing is better than sec when it comes to monitoring Big Data applications. Try Boundary one-second resolution app monitoring today. Free. http://p.sf.net/sfu/Boundary-dev2dev _______________________________________________ Matplotlib-users mailing list Mat...@li... https://lists.sourceforge.net/lists/listinfo/matplotlib-users |