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
(12) |
2
(13) |
3
(14) |
4
(9) |
|
5
(9) |
6
(22) |
7
(17) |
8
(16) |
9
(19) |
10
(17) |
11
(6) |
|
12
|
13
(20) |
14
(21) |
15
(20) |
16
(10) |
17
(14) |
18
(3) |
|
19
(3) |
20
(12) |
21
(22) |
22
(26) |
23
(31) |
24
(26) |
25
(9) |
|
26
(4) |
27
(33) |
28
(15) |
29
(37) |
30
(26) |
|
|
|
From: jtamir <jt...@ar...> - 2009-04-13 23:04:02
|
Andrew Straw wrote: > > That's the first error -- and it's quite diagnostic. gcc can't find > Python.h. > Looks like I didn't have the python-dev package installed - I wasn't aware it was necessary (still relatively new to these things!). Basemap is now working correctly. Thanks for the help, Jon -- View this message in context: http://www.nabble.com/Basemap-Installation-Errors-tp22915617p23030458.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
|
From: C M <cmp...@gm...> - 2009-04-13 22:34:12
|
Hi, I've asked this before but still am stuck. I want to use mpl's automatic tick locating and date formatting for a zoomable date plot, OTHER THAN the hour formatting. The default hour formatting (when zoomed in on 1 day) is like "05:00:00 UTC", but I'd like to be of the form something more readable for users, like: "5:00pm 12/03". If I just use my own custom date formatter, then ALL the zoom levels will have this format, but I'd only like it for when the plot is zoomed down to the level of one day. (So it is a rule of "if zoomed to one day, use my custom dateformatter, otherwise, use the automatic one"). Why I'd like this: for looking across weeks or months worth of data, hours are irrelevant, but for looking at days, hours are relevant, but users will not think in terms of UTC and they will want to see on the x axis which day they are looking at. Does anyone know how this can be done in mpl? Thank you, Che |
|
From: Paul de B. <pau...@gm...> - 2009-04-13 22:27:30
|
When installing matplotlib-0.98.5.2.win32-py2.5.exe on Windows Vista I got the messages 'Could not create key matplotlib-py2.5' and 'Could not set key value Python 2.5 matplotlib-0,98.5.2'. Any idea what is wrong? |
|
From: Jim V. <Jim...@no...> - 2009-04-13 18:02:51
|
Jae-Joon Lee wrote: > Is there any particular reason that you have to use pcolor? > None whatsoever; it is simply what I first encountered in an example. > My understanding is that the imshow is the fastest. > Also, pcolormesh is much faster than pcolor if you use agg backend. > Your script runs in a second on my linux box if I replace pcolor with > pcolormesh. > I saw pcolormesh() documented but did not understand its significance. I struggle to understand all of the matplotlib variants. Substituting pcolormesh() for pcolor(), my script now also runs in under a second on my Microsoft box -- an amazing difference! Thanks very much for your quick response! -- jv > -JJ > > > On Mon, Apr 13, 2009 at 10:54 AM, Jim Vickroy <Jim...@no...> wrote: > >> Hello all, >> >> I am a matplotlib novice so I expect I am doing something inappropriate. >> >> >From the attached script (matplotlib-slow.py), it will be seen that I am >> creating a 512x512 (numpy) array and using matplotlib to plot it. >> >> Below is the script output on my Microsoft Windows XP (service pack 3) box: >> >> <session> >> >>> matplotlib-slow.py >>> >> [2009-04-13 08:40:34] [DEBUG ] [line # 23] Python version: 2.5.4 >> (r254:67916, Dec 23 2008, 15:10:54) [MSC v.1310 32 bit (Intel)] >> [2009-04-13 08:40:34] [DEBUG ] [line # 24] numpy version: 1.2.1 >> [2009-04-13 08:40:34] [DEBUG ] [line # 25] matplotlib version: 0.98.5.2 >> [2009-04-13 08:40:34] [DEBUG ] [line # 37] executing >> matplotlib.pyplot.subplot() >> [2009-04-13 08:40:34] [DEBUG ] [line # 39] executing >> matplotlib.pyplot.pcolor() >> [2009-04-13 08:41:12] [DEBUG ] [line # 41] executing >> matplotlib.pyplot.colorbar() >> [2009-04-13 08:41:12] [DEBUG ] [line # 45] executing >> matplotlib.pyplot.savefig() >> [2009-04-13 08:41:35] [DEBUG ] [line # 47] executing >> matplotlib.pyplot.close() >> </session> >> >> Note, the call to pcolor() and savefig() consume 38 and 13 seconds >> respectively. My goal is to dramatically reduce these times (1 second or >> less). >> >> I would appreciate your suggestions. >> >> Thanks, >> -- jv >> >> ------------------------------------------------------------------------------ >> This SF.net email is sponsored by: >> High Quality Requirements in a Collaborative Environment. >> Download a free trial of Rational Requirements Composer Now! >> http://p.sf.net/sfu/www-ibm-com >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> >> >> |
|
From: Jae-Joon L. <lee...@gm...> - 2009-04-13 16:44:31
|
Is there any particular reason that you have to use pcolor? My understanding is that the imshow is the fastest. Also, pcolormesh is much faster than pcolor if you use agg backend. Your script runs in a second on my linux box if I replace pcolor with pcolormesh. -JJ On Mon, Apr 13, 2009 at 10:54 AM, Jim Vickroy <Jim...@no...> wrote: > Hello all, > > I am a matplotlib novice so I expect I am doing something inappropriate. > > >From the attached script (matplotlib-slow.py), it will be seen that I am > creating a 512x512 (numpy) array and using matplotlib to plot it. > > Below is the script output on my Microsoft Windows XP (service pack 3) box: > > <session> >>matplotlib-slow.py > [2009-04-13 08:40:34] [DEBUG ] [line # 23] Python version: 2.5.4 > (r254:67916, Dec 23 2008, 15:10:54) [MSC v.1310 32 bit (Intel)] > [2009-04-13 08:40:34] [DEBUG ] [line # 24] numpy version: 1.2.1 > [2009-04-13 08:40:34] [DEBUG ] [line # 25] matplotlib version: 0.98.5.2 > [2009-04-13 08:40:34] [DEBUG ] [line # 37] executing > matplotlib.pyplot.subplot() > [2009-04-13 08:40:34] [DEBUG ] [line # 39] executing > matplotlib.pyplot.pcolor() > [2009-04-13 08:41:12] [DEBUG ] [line # 41] executing > matplotlib.pyplot.colorbar() > [2009-04-13 08:41:12] [DEBUG ] [line # 45] executing > matplotlib.pyplot.savefig() > [2009-04-13 08:41:35] [DEBUG ] [line # 47] executing > matplotlib.pyplot.close() > </session> > > Note, the call to pcolor() and savefig() consume 38 and 13 seconds > respectively. My goal is to dramatically reduce these times (1 second or > less). > > I would appreciate your suggestions. > > Thanks, > -- jv > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by: > High Quality Requirements in a Collaborative Environment. > Download a free trial of Rational Requirements Composer Now! > http://p.sf.net/sfu/www-ibm-com > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > |
|
From: John H. <jd...@gm...> - 2009-04-13 16:38:32
|
On Mon, Apr 13, 2009 at 11:20 AM, rmber <rya...@gm...> wrote: > > Is there a way to make imshow scale images to dimensions other than that of > the arrya passed to it? I'm trying to plot a long matrix (like 23x5000) and > imshow doesn't work very well since it makes a very vertically thin plot and > its hard to see anything. I would like the image to dynamically scale with > windows size like if you plotted something with specgram() or plot(). > Just pass in aspect='auto' as a keyword argument to imshow. JDH |
|
From: Jae-Joon L. <lee...@gm...> - 2009-04-13 16:35:39
|
Explicitly set the aspect to "auto". imshow(image, aspect="auto") http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.imshow -JJ On Mon, Apr 13, 2009 at 12:20 PM, rmber <rya...@gm...> wrote: > > Is there a way to make imshow scale images to dimensions other than that of > the arrya passed to it? I'm trying to plot a long matrix (like 23x5000) and > imshow doesn't work very well since it makes a very vertically thin plot and > its hard to see anything. I would like the image to dynamically scale with > windows size like if you plotted something with specgram() or plot(). > > Thanks, > > Ryan > -- > View this message in context: http://www.nabble.com/imshow-scaling-tp23024632p23024632.html > Sent from the matplotlib - users mailing list archive at Nabble.com. > > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by: > High Quality Requirements in a Collaborative Environment. > Download a free trial of Rational Requirements Composer Now! > http://p.sf.net/sfu/www-ibm-com > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
|
From: rmber <rya...@gm...> - 2009-04-13 16:20:09
|
Is there a way to make imshow scale images to dimensions other than that of the arrya passed to it? I'm trying to plot a long matrix (like 23x5000) and imshow doesn't work very well since it makes a very vertically thin plot and its hard to see anything. I would like the image to dynamically scale with windows size like if you plotted something with specgram() or plot(). Thanks, Ryan -- View this message in context: http://www.nabble.com/imshow-scaling-tp23024632p23024632.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
|
From: Jeff W. <js...@fa...> - 2009-04-13 14:46:21
|
antonv wrote: > Hi all, > > I have a weird thing happening with basemap and I am not sure if it's > basemap or me, but more than likely it's me :( > > Here is the grib file that I am using: > http://downloads.75ive.com/multi_1.20090321.t18z_multi_1.wc_10m.all.grb2 > http://downloads.75ive.com/multi_1.20090321.t18z_multi_1.wc_10m.all.grb2 > > And here is my code: > ############################################# > import matplotlib > import matplotlib.mpl as mpl > import matplotlib.pyplot as plt > import matplotlib.mlab as mlab > import numpy as np > import matplotlib.pylab as pylab > from mpl_toolkits.basemap import Basemap > from grib2 import Grib2Decode > > grbs = Grib2Decode('multi_1.20090321.t18z_multi_1.wc_10m.all.grb2') > > lats, lons = grbs[0].grid() > mapCoords = [32.35,-121.0,34.75,-116.75] > #mapCoords = [lats.min(),lons.min(),lats.max(),lons.max()] > > colorList = > [[0.,0.,205./255.],[0,102./255.,255./255.],[0,183./255.,255./255.],[0,224./255.,255./255.], > > [0,255./255.,255./255.],[0,255./255.,204./255.],[0,255./255.,153./255.],[0,255./255.,0], > > [153./255.,255./255.,0],[204./255.,255./255.,0],[255./255.,255./255.,0],[255./255.,204./255.,0], > > [255./255.,153./255.,0],[255./255.,102./255.,0],[255./255.,0,0],[176./255.,48./255.,96./255.], > [208./255.,32./255.,144./255.],[255./255.,0,255./255.]] > cmap = matplotlib.colors.ListedColormap(colorList, name = 'theColorMap', N = > len(colorList)) > > m = Basemap(projection='merc',lat_ts = 30,\ > > llcrnrlat=mapCoords[0],llcrnrlon=mapCoords[1],urcrnrlat=mapCoords[2],urcrnrlon=mapCoords[3],\ > resolution='h',area_thresh=0.5, suppress_ticks = True) > > fig = plt.figure(figsize=(14.58,10.58)) > fig.set_dpi(100) > > nlats, nlons = grbs[0].data().shape > > x = np.linspace(lons.min(),lons.max(),nlons) > y = np.linspace(lats.min(),lats.max(),nlats) > > X, Y = m(*np.meshgrid(x, y)) > > z = grbs[0].data().filled(1) > > m.contourf(X,Y,z,cmap=cmap,levels=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19],extend='both') > > m.fillcontinents(color='green',lake_color='b') > m.drawcoastlines(color='k', linewidth=0.75) > m.drawcountries(color='k', linewidth=0.25) > m.drawstates(color='k', linewidth=0.25) > m.drawmapboundary(linewidth=1.0, color='k') > > plt.show() > ############################################# > > If you look at lines 14 and 15 you can see that i have a variable called > mapCoords that feeds the lat/lon coordinates to the basemap object. If i set > them up using the commented line (line 15) it will plot the map for all the > data in the file and it will display it correctly. If i use line 14 which is > the zoomed area that i am interested in it will display the basemap map > correctly zoomed in but it will not show the plotted data. Any ideas on what > is happening here? > > Also, if you have any comments on optimizing the code I would really > appreciate it! > > Thanks, > Anton > > Anton: Probably your data doesn't cover the zoomed region, but without actually having your data I can't be sure. One question: why are you rebuilding the lons and lats from scratch when you already have them? It seems like you can get rid of nlats, nlons = grbs[0].data().shape x = np.linspace(lons.min(),lons.max(),nlons) y = np.linspace(lats.min(),lats.max(),nlats) X, Y = m(*np.meshgrid(x, y)) and replace it with X,Y = m(lons, lats) -Jeff -- Jeffrey S. Whitaker Phone : (303)497-6313 Meteorologist FAX : (303)497-6449 NOAA/OAR/PSD R/PSD1 Email : Jef...@no... 325 Broadway Office : Skaggs Research Cntr 1D-113 Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg |
|
From: Michael D. <md...@st...> - 2009-04-13 13:40:14
|
One of the cool things about Debian-esque distros is you can say: apt-get build-dep python-matplotlib which will install all of the build dependencies for matplotlib. It will download a lot, but if bandwidth/disk space is not an issue, it's nicely automated. That's one of the first things I do on any new Ubuntu or Debian install -- and then I check out matplotlib from source or SVN and build with no problems. Cheers, Mike bollweevil wrote: > sudo apt-get install python-matplotlib > #This only gets matplotlib-0.91 > > I have tried downloading the matplotlib-0.98.5.2.tar.gz, but it requires an > incredibly large number of prerequisites, and each of the prerequisites > requires prerequisites, and I have now wasted hours on this. > > Please help me install matplotlib-0.98 on Ubuntu 8.04 Hardy Heron. I know > that there is an apt-get package to install matplotlib-0.98 on Ubuntu > Jaunty, but I don't know how to use it on Hardy. > > Thanks. > -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA |
|
From: Jouni K. S. <jk...@ik...> - 2009-04-13 10:41:47
|
siz siz <cut...@gm...> writes: > I have 2 plots and want them have the same colorbar scale so that I > could compare the minima or maxima. You can do it like this: mn = min(data1.min(), data2.min()) mx = max(data1.max(), data2.max()) norm = matplotlib.colors.Normalize(mn, mx) figure(); contourf(data1, norm=norm); colorbar() figure(); contourf(data2, norm=norm); colorbar() -- Jouni K. Seppänen http://www.iki.fi/jks |
|
From: Douglas M. <du...@ar...> - 2009-04-13 09:58:45
|
Dear Eric and John, Thank both for your help. John, I'll use your solution for now. Eric, when it comes through my repository, I'll try your solution. Again thanks. Best, Douglas 2009/4/13 Eric Firing <ef...@ha...>: > John Hunter wrote: >> >> On Thu, Apr 9, 2009 at 4:02 PM, mm2ps <du...@ar...> >> wrote: >>> >>> Hi, >>> >>> How would you check that there is something to show() before you show()? >> >> Although it is a bit inelegant, you could use the _pylab_helpers >> module to see how many figure managers are active > > In svn trunk this is exposed in pyplot.py: > > len(pyplot.get_fignums()) > > should do it. > > Eric > >> >> >> home:~> ipython -pylab >> Python 2.5 (r25:51918, Sep 19 2006, 08:49:13) >> Type "copyright", "credits" or "license" for more information. >> >> IPython 0.9.1 -- An enhanced Interactive Python. >> ? -> Introduction and overview of IPython's features. >> %quickref -> Quick reference. >> help -> Python's own help system. >> object? -> Details about 'object'. ?object also works, ?? prints more. >> >> Welcome to pylab, a matplotlib-based Python environment. >> For more information, type 'help(pylab)'. >> >> In [1]: plot([1,2,3]) >> Out[1]: [<matplotlib.lines.Line2D object at 0x46bfd70>] >> >> In [2]: import matplotlib._pylab_helpers as _pylab_helpers >> >> In [3]: print _pylab_helpers.Gcf.get_num_fig_managers() >> 1 >> >> JDH >> >> >> ------------------------------------------------------------------------------ >> This SF.net email is sponsored by: >> High Quality Requirements in a Collaborative Environment. >> Download a free trial of Rational Requirements Composer Now! >> http://p.sf.net/sfu/www-ibm-com >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > |
|
From: antonv <vas...@ya...> - 2009-04-13 04:41:50
|
Hi all, I have a weird thing happening with basemap and I am not sure if it's basemap or me, but more than likely it's me :( Here is the grib file that I am using: http://downloads.75ive.com/multi_1.20090321.t18z_multi_1.wc_10m.all.grb2 http://downloads.75ive.com/multi_1.20090321.t18z_multi_1.wc_10m.all.grb2 And here is my code: ############################################# import matplotlib import matplotlib.mpl as mpl import matplotlib.pyplot as plt import matplotlib.mlab as mlab import numpy as np import matplotlib.pylab as pylab from mpl_toolkits.basemap import Basemap from grib2 import Grib2Decode grbs = Grib2Decode('multi_1.20090321.t18z_multi_1.wc_10m.all.grb2') lats, lons = grbs[0].grid() mapCoords = [32.35,-121.0,34.75,-116.75] #mapCoords = [lats.min(),lons.min(),lats.max(),lons.max()] colorList = [[0.,0.,205./255.],[0,102./255.,255./255.],[0,183./255.,255./255.],[0,224./255.,255./255.], [0,255./255.,255./255.],[0,255./255.,204./255.],[0,255./255.,153./255.],[0,255./255.,0], [153./255.,255./255.,0],[204./255.,255./255.,0],[255./255.,255./255.,0],[255./255.,204./255.,0], [255./255.,153./255.,0],[255./255.,102./255.,0],[255./255.,0,0],[176./255.,48./255.,96./255.], [208./255.,32./255.,144./255.],[255./255.,0,255./255.]] cmap = matplotlib.colors.ListedColormap(colorList, name = 'theColorMap', N = len(colorList)) m = Basemap(projection='merc',lat_ts = 30,\ llcrnrlat=mapCoords[0],llcrnrlon=mapCoords[1],urcrnrlat=mapCoords[2],urcrnrlon=mapCoords[3],\ resolution='h',area_thresh=0.5, suppress_ticks = True) fig = plt.figure(figsize=(14.58,10.58)) fig.set_dpi(100) nlats, nlons = grbs[0].data().shape x = np.linspace(lons.min(),lons.max(),nlons) y = np.linspace(lats.min(),lats.max(),nlats) X, Y = m(*np.meshgrid(x, y)) z = grbs[0].data().filled(1) m.contourf(X,Y,z,cmap=cmap,levels=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19],extend='both') m.fillcontinents(color='green',lake_color='b') m.drawcoastlines(color='k', linewidth=0.75) m.drawcountries(color='k', linewidth=0.25) m.drawstates(color='k', linewidth=0.25) m.drawmapboundary(linewidth=1.0, color='k') plt.show() ############################################# If you look at lines 14 and 15 you can see that i have a variable called mapCoords that feeds the lat/lon coordinates to the basemap object. If i set them up using the commented line (line 15) it will plot the map for all the data in the file and it will display it correctly. If i use line 14 which is the zoomed area that i am interested in it will display the basemap map correctly zoomed in but it will not show the plotted data. Any ideas on what is happening here? Also, if you have any comments on optimizing the code I would really appreciate it! Thanks, Anton -- View this message in context: http://www.nabble.com/basemap-error-or-user-error--tp23017806p23017806.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
|
From: antonv <vas...@ya...> - 2009-04-13 04:24:07
|
-- View this message in context: http://www.nabble.com/basemap-error-or-user-error--tp23017751p23017751.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
|
From: Jae-Joon L. <lee...@gm...> - 2009-04-13 04:08:43
|
The recent version of the mpl now supports multi-column legend. http://matplotlib.sourceforge.net/examples/pylab_examples/legend_demo3.html Thus, it would be great if you to try the new version, and if your problem is still not solved, please report it again. Regards, -JJ On Sun, Apr 12, 2009 at 11:12 PM, Vasileios Kontorinis <bko...@gm...> wrote: > Jae-Joon hi, > > I am a newbie with matplolib. I need a horizontal legend because my > figures are pretty wide and I need to automate the process of generating it. > > Since matplotlib does not support horizontal legends I am hacking around it. > > I modified your example below. So the following works: > > from matplotlib.pylab import * > from matplotlib.legend import Legend > from matplotlib.patches import Rectangle > > #fig = figure() > ax = gca() > pl_list = [] > for i in range(10): > pl, = ax.plot(random(10)) > pl_list.append(pl) > > xleg,yleg= 0.5,0.5 > > l1 = Legend(ax, pl_list[0:1], "0", loc=1) > hg1, wd1 = l1.get_frame().get_height(), l1.get_frame().get_width() > l2 = Legend(ax, pl_list[1:2], "1", loc=1) > hg2, wd2 = l2.get_frame().get_height(), l2.get_frame().get_width() > l3 = Legend(ax, pl_list[2:3], "2", loc=1) > hg3, wd3 = l3.get_frame().get_height(), l3.get_frame().get_width() > l4 = Legend(ax, pl_list[3:4], "3", loc=1) > hg4, wd4 = l4.get_frame().get_height(), l4.get_frame().get_width() > > total_height = hg1 > total_width = wd1+wd2+wd3+wd4 > > print total_height, total_width > > l1 = Legend(ax, pl_list[0:1], "0", loc=(xleg, yleg)) > l2 = Legend(ax, pl_list[1:2], "1", loc=(xleg+wd1/5, yleg)) > l3 = Legend(ax, pl_list[2:3], "2", loc=(xleg+(wd1+wd2)/5, yleg)) > l4 = Legend(ax, pl_list[3:4], "3", loc=(xleg+(wd1+wd2+wd3)/5, yleg)) > l1.get_frame().set_visible(False) # make background frame of legends > invisible > l2.get_frame().set_visible(False) > l3.get_frame().set_visible(False) > l4.get_frame().set_visible(False) > > # make a large background frame > rect = Rectangle((xleg, yleg), 0.45, 0.05, # adjust these values (in > normalized axes coordinate) > fc="w", ec="k", > transform=ax.transAxes, zorder=4) > ax.add_artist(rect) > ax.add_artist(l1) > ax.add_artist(l2) > ax.add_artist(l3) > ax.add_artist(l4) > > > The basic idea is to create a legend with the line and label I need and then > use its dimensions to create the background frame. > > The problem is that the height and width I get are in different units that > the normalized axes coordinates and I do not know how > > to properly transfrom them which leads to the hacky /5 , otherwise the > legends are off the figure. > > Any suggestions on how I can automate this part? > > Thanks in advance. > > > Jae-Joon Lee > Thu, 09 Oct 2008 12:21:56 -0700 > > Although I think it is possible to calculate the bounding box of the > all legends automatically, > Here is a manual way. > > > from matplotlib.patches import Rectangle > > l1.get_frame().set_visible(False) # make background frame of legends > invisible > > l2.get_frame().set_visible(False) > > # make a large background frame > rect = Rectangle((0.05, 0.75), 0.3, 0.2, # adjust these values (in > normalized axes coordinate) > fc="w", ec="k", > > transform=ax.transAxes, zorder=4) > ax.add_artist(rect) > > I hope this help, > > -JJ > > > > > On Thu, Oct 9, 2008 at 2:43 PM, José Alexandre Nalon <[EMAIL PROTECTED]> > wrote: >> Hello, > >> >> Em Thursday 09 October 2008 13:46:52 Jae-Joon Lee escreveu: >>> Meanwhile, you may try to make multiple legends as a posible workarounds. >> >> Thanks for your answer. That did the trick, and the figure > >> looks more or less as I wanted. It would look exactly as I >> wanted if I could remove the border from the legends and >> draw a box around the legends. How could I do that? >> >> (I apologize if this seems trivial. I use matplotlib a lot, > >> but standard functions always seem to do what I need, so I >> don't go deep in its behaviour). >> >> -- >> José Alexandre Nalon >> [EMAIL PROTECTED] >> >> ------------------------------------------------------------------------- > >> This SF.Net email is sponsored by the Moblin Your Move Developer's >> challenge >> Build the coolest Linux based applications with Moblin SDK & win great >> prizes >> Grand prize is a trip for two to an Open Source event anywhere in the >> world > >> http://moblin-contest.org/redirect.php?banner_id=100&url=/ >> _______________________________________________ >> Matplotlib-users mailing list > >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users > >> > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great > prizes > > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by: > High Quality Requirements in a Collaborative Environment. > Download a free trial of Rational Requirements Composer Now! > http://p.sf.net/sfu/www-ibm-com > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > |
|
From: Eric F. <ef...@ha...> - 2009-04-13 03:57:40
|
John Hunter wrote: > On Thu, Apr 9, 2009 at 4:02 PM, mm2ps <du...@ar...> wrote: >> Hi, >> >> How would you check that there is something to show() before you show()? > > Although it is a bit inelegant, you could use the _pylab_helpers > module to see how many figure managers are active In svn trunk this is exposed in pyplot.py: len(pyplot.get_fignums()) should do it. Eric > > > home:~> ipython -pylab > Python 2.5 (r25:51918, Sep 19 2006, 08:49:13) > Type "copyright", "credits" or "license" for more information. > > IPython 0.9.1 -- An enhanced Interactive Python. > ? -> Introduction and overview of IPython's features. > %quickref -> Quick reference. > help -> Python's own help system. > object? -> Details about 'object'. ?object also works, ?? prints more. > > Welcome to pylab, a matplotlib-based Python environment. > For more information, type 'help(pylab)'. > > In [1]: plot([1,2,3]) > Out[1]: [<matplotlib.lines.Line2D object at 0x46bfd70>] > > In [2]: import matplotlib._pylab_helpers as _pylab_helpers > > In [3]: print _pylab_helpers.Gcf.get_num_fig_managers() > 1 > > JDH > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by: > High Quality Requirements in a Collaborative Environment. > Download a free trial of Rational Requirements Composer Now! > http://p.sf.net/sfu/www-ibm-com > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
|
From: Vasileios K. <bko...@gm...> - 2009-04-13 03:12:53
|
Jae-Joon hi,
I am a newbie with matplolib. I need a horizontal legend because my
figures are pretty wide and I need to automate the process of generating it.
Since matplotlib does not support horizontal legends I am hacking around it.
I modified your example below. So the following works:
from matplotlib.pylab import *
from matplotlib.legend import Legend
from matplotlib.patches import Rectangle
#fig = figure()
ax = gca()
pl_list = []
for i in range(10):
pl, = ax.plot(random(10))
pl_list.append(pl)
xleg,yleg= 0.5,0.5
l1 = Legend(ax, pl_list[0:1], "0", loc=1)
hg1, wd1 = l1.get_frame().get_height(), l1.get_frame().get_width()
l2 = Legend(ax, pl_list[1:2], "1", loc=1)
hg2, wd2 = l2.get_frame().get_height(), l2.get_frame().get_width()
l3 = Legend(ax, pl_list[2:3], "2", loc=1)
hg3, wd3 = l3.get_frame().get_height(), l3.get_frame().get_width()
l4 = Legend(ax, pl_list[3:4], "3", loc=1)
hg4, wd4 = l4.get_frame().get_height(), l4.get_frame().get_width()
total_height = hg1
total_width = wd1+wd2+wd3+wd4
print total_height, total_width
l1 = Legend(ax, pl_list[0:1], "0", loc=(xleg, yleg))
l2 = Legend(ax, pl_list[1:2], "1", loc=(xleg+wd1/5, yleg))
l3 = Legend(ax, pl_list[2:3], "2", loc=(xleg+(wd1+wd2)/5, yleg))
l4 = Legend(ax, pl_list[3:4], "3", loc=(xleg+(wd1+wd2+wd3)/5, yleg))
l1.get_frame().set_visible(False) # make background frame of legends
invisible
l2.get_frame().set_visible(False)
l3.get_frame().set_visible(False)
l4.get_frame().set_visible(False)
# make a large background frame
rect = Rectangle((xleg, yleg), 0.45, 0.05, # adjust these values (in
normalized axes coordinate)
fc="w", ec="k",
transform=ax.transAxes, zorder=4)
ax.add_artist(rect)
ax.add_artist(l1)
ax.add_artist(l2)
ax.add_artist(l3)
ax.add_artist(l4)
The basic idea is to create a legend with the line and label I need and then
use its dimensions to create the background frame.
The problem is that the height and width I get are in different units that
the normalized axes coordinates and I do not know how
to properly transfrom them which leads to the hacky /5 , otherwise the
legends are off the figure.
Any suggestions on how I can automate this part?
Thanks in advance.
Jae-Joon Lee
Thu, 09 Oct 2008 12:21:56 -0700
Although I think it is possible to calculate the bounding box of the
all legends automatically,
Here is a manual way.
from matplotlib.patches import Rectangle
l1.get_frame().set_visible(False) # make background frame of legends invisible
l2.get_frame().set_visible(False)
# make a large background frame
rect = Rectangle((0.05, 0.75), 0.3, 0.2, # adjust these values (in
normalized axes coordinate)
fc="w", ec="k",
transform=ax.transAxes, zorder=4)
ax.add_artist(rect)
I hope this help,
-JJ
On Thu, Oct 9, 2008 at 2:43 PM, José Alexandre Nalon <[EMAIL PROTECTED]> wrote:
> Hello,
>
> Em Thursday 09 October 2008 13:46:52 Jae-Joon Lee escreveu:
>> Meanwhile, you may try to make multiple legends as a posible workarounds.
>
> Thanks for your answer. That did the trick, and the figure
> looks more or less as I wanted. It would look exactly as I
> wanted if I could remove the border from the legends and
> draw a box around the legends. How could I do that?
>
> (I apologize if this seems trivial. I use matplotlib a lot,
> but standard functions always seem to do what I need, so I
> don't go deep in its behaviour).
>
> --
> José Alexandre Nalon
> [EMAIL PROTECTED]
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Matplotlib-users mailing list
Mat...@li...
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
|
|
From: John H. <jd...@gm...> - 2009-04-13 03:07:06
|
On Thu, Apr 9, 2009 at 4:02 PM, mm2ps <du...@ar...> wrote: > > Hi, > > How would you check that there is something to show() before you show()? Although it is a bit inelegant, you could use the _pylab_helpers module to see how many figure managers are active home:~> ipython -pylab Python 2.5 (r25:51918, Sep 19 2006, 08:49:13) Type "copyright", "credits" or "license" for more information. IPython 0.9.1 -- An enhanced Interactive Python. ? -> Introduction and overview of IPython's features. %quickref -> Quick reference. help -> Python's own help system. object? -> Details about 'object'. ?object also works, ?? prints more. Welcome to pylab, a matplotlib-based Python environment. For more information, type 'help(pylab)'. In [1]: plot([1,2,3]) Out[1]: [<matplotlib.lines.Line2D object at 0x46bfd70>] In [2]: import matplotlib._pylab_helpers as _pylab_helpers In [3]: print _pylab_helpers.Gcf.get_num_fig_managers() 1 JDH |
|
From: antonv <vas...@ya...> - 2009-04-13 02:51:20
|
Thanks, that's exactly what i was looking for! Anton Jae-Joon Lee wrote: > > I guess you want this. > > http://docs.scipy.org/doc/numpy/reference/generated/numpy.ma.filled.html#numpy.ma.filled > > -JJ > > > On Sat, Apr 11, 2009 at 3:36 PM, antonv <vas...@ya...> wrote: >> >> Hi all, >> >> Another noob question here. I have a large masked array that I am >> plotting >> with "contourf" and because of the masked array i am getting jagged >> edges. >> If i could replace the masked data with a value that I supply then it >> will >> interpolate and give me the nice feathered edges that I need. >> >> Now my question is, what is the fastest way to add the supplied data to >> the >> masked areas? The only way I can think is to just iterate through the >> whole >> array and set the value of the masked areas to the value I want but I >> guess >> there should be other faster ways to do that. >> >> Any help is greatly appreciated! >> >> Thanks, >> Anton >> -- >> View this message in context: >> http://www.nabble.com/convert-a-masked-array-to-a-non-masked-one--tp23004653p23004653.html >> Sent from the matplotlib - users mailing list archive at Nabble.com. >> >> >> ------------------------------------------------------------------------------ >> This SF.net email is sponsored by: >> High Quality Requirements in a Collaborative Environment. >> Download a free trial of Rational Requirements Composer Now! >> http://p.sf.net/sfu/www-ibm-com >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by: > High Quality Requirements in a Collaborative Environment. > Download a free trial of Rational Requirements Composer Now! > http://p.sf.net/sfu/www-ibm-com > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > -- View this message in context: http://www.nabble.com/convert-a-masked-array-to-a-non-masked-one--tp23004653p23017179.html Sent from the matplotlib - users mailing list archive at Nabble.com. |