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
(35) |
2
(29) |
3
(12) |
4
|
5
(8) |
6
(5) |
|
7
(3) |
8
(38) |
9
(15) |
10
(20) |
11
(14) |
12
(12) |
13
(17) |
|
14
(6) |
15
(41) |
16
(38) |
17
(31) |
18
(7) |
19
(14) |
20
(12) |
|
21
(3) |
22
(3) |
23
(15) |
24
(4) |
25
|
26
(3) |
27
(2) |
|
28
(7) |
29
(16) |
30
(17) |
31
(10) |
|
|
|
|
From: Jeff W. <js...@fa...> - 2008-12-08 17:02:39
|
Mauro Cavalcanti wrote: > Dear ALL, > > I am using Basemap version 0.90 with MPL version 0.98.3 under Linux > Ubuntu, both installed from Andrew Straw repository (I just prefer to > install from repositories via apt than directly from the sources, > although in this case I do not have always the latest versions). > > I stumbled upon a few issues that I could not solve by looking at the > available documentation. They are not really critical for me, but I > would be interested in finding some more about them anyway. > > Here they are: > > i) When trying some of the projections listed in the Basemap > documentation, I got a message saying that this or that projection is > not available, what leads me to think that these projections have only > been included in later versions of Basemap. However, I could not find > this in the documentation. This is not critical for my current > project, as I have no need to offer so many projections, but I would > like to know. > > ii) The plotting of rivers using the drawrivers() method is painfully > slow, even with resolution set to "crude". The FAQ provided with the > Basemap source package offers an interesting suggestion for > potentially solving this, but an exemple would be in order (the FAQ > mentions an "ireland.py" example which I have however not found in the > examples directory). > > iii) In the same context as the above, I would be interested in > knowing if there is some way to speed up the plotting of a map with > the Blue Marble image superimposed on it.\ > Mauro: I just added a 'scale' keyword to bluemarble that downsamples the image to speed things up. scale=1.0 (the default) gives the same answer as before (the full resolution image). scale=0.5 downsamples the image to half the original size, speeding things up considerably (and using a lot less memory, which I think is the real problem). -Jeff > In general, I would like to suggest that the Basemap FAQ could be > expanded and made available in the website, along with, perhaps, some > the examples provided in the Basemap distribution package (in the same > way the examples are provided in the MPL page). > > Well, hope this helps! > > Have a nice weekend. > > With best regards, > > -- 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: Ryan M. <rm...@gm...> - 2008-12-08 16:56:50
|
John Hunter wrote: > On Mon, Dec 8, 2008 at 9:10 AM, Fago, Matt - AES <Mat...@it...> wrote: >> So what is to be done here? It seems to me that at least the factor of two should be >> fixed for one-sided PSDs, and the 1/fs normalization difference with Matlab >> documented. Ideally, I'd think this normalization would be on by default, with the >> option to turn it off. >> >> Are you planning to submit a patch, or shall I look into it? If I submit a patch, does matplotlib >> require a copyright assignment? > > If you submit a patch, we assume you are agreeing to the mpl licensing > terms, so you do not need to explicitly do anything. As for the > decision about how the defaults and kwargs should behave, I'll defer > to you and Ryan. I'm fine with coding up a patch to handle the scaling. Since it seems Matlab compatibility is the key desire here, making the Matlab scaling the default is fine by me. I, myself, am more than capable of turning on a keyword argument. I see two independent changes here: 1) Scaling by factor of two for one-sided psd -- Doesn't need a keyword argument, just makes sense. 2) Scaling by 1/Fs. I'm still not sure why Matlab is doing this, other than perhaps to make the PSD dB/Hz instead of dB/(rad/s). Needs a new keyword argument. Suggestions on what exactly this should be called? scale_by_freq? My only other concern is whether this belongs in 0.98.x. This is a behavior change from 0.98.3, not necessarily a bug fix. I'll defer to John, et al. on whether this should go in 0.98.x or go in a later release. Ryan -- Ryan May Graduate Research Assistant School of Meteorology University of Oklahoma |
|
From: John H. <jd...@gm...> - 2008-12-08 15:17:50
|
On Mon, Dec 8, 2008 at 9:10 AM, Fago, Matt - AES <Mat...@it...> wrote: > > So what is to be done here? It seems to me that at least the factor of two should be > fixed for one-sided PSDs, and the 1/fs normalization difference with Matlab > documented. Ideally, I'd think this normalization would be on by default, with the > option to turn it off. > > Are you planning to submit a patch, or shall I look into it? If I submit a patch, does matplotlib > require a copyright assignment? If you submit a patch, we assume you are agreeing to the mpl licensing terms, so you do not need to explicitly do anything. As for the decision about how the defaults and kwargs should behave, I'll defer to you and Ryan. JDH |
|
From: Fago, M. - A. <Mat...@it...> - 2008-12-08 15:10:50
|
So what is to be done here? It seems to me that at least the factor of two should be fixed for one-sided PSDs, and the 1/fs normalization difference with Matlab documented. Ideally, I'd think this normalization would be on by default, with the option to turn it off. Are you planning to submit a patch, or shall I look into it? If I submit a patch, does matplotlib require a copyright assignment? Thanks, Matt ________________________________________ From: Ryan May [rm...@gm...] Sent: Monday, December 01, 2008 3:31 PM To: Fago, Matt - AES Cc: Matplotlib Users Subject: Re: [Matplotlib-users] Matplotlib PSD bug? Fago, Matt - AES wrote: > I suppose the issue is: what is correct? Or is it a matter of definition? > > I don't have Stoica and Moses, but Bendat and Piersol eqn 11.102: > > One_Sided_PSD = 2/(n_d * N * dt) * Sum(FFT^2) > > where there are n_d is the number of averages and N is the number of points in the FFT. > That seems to be scaling by the length? I'm fairly certain that the factor of two (as shown > above) is required for a one-sided PSD, as that comes from 'removing' the negative > frequency range. > > Note that Matlab shows such scaling (by 2/L) even when computing the power spectra directly > from a raw (unaveraged) FFT: > > http://www.mathworks.com/support/tech-notes/1700/1702.html > > To me, as Matplotlib is striving to be Matlab-compatible, the default behaviour should be to > give results as close to the Matlab implementation as possible. One could always have an > option to turn off the scaling. Yeah, scaling by a factor of two for one-sided is definitely correct now that I think about it. Note, however, that the scaling by the length is not the problem. In fact, the current psd implementation does this correctly when it corrects for the power in the window. The problem stems from matlab scaling by the sampling frequency. Stoica and Moses don't do this, nor does Welch 1967. I'm all for doing things in a Matlab-compatible way--when they're correct. One of the reasons I stopped using Matlab was that it tried to be too smart for me. > Note that the Matplotlib results also seem to have significantly less frequency resolution than > the Matlab results. Is this the case, or am I not using noffset, nfft, and pad_to correctly? It's not that you're using those incorrectly, but rather that you failed to notice that the default window is the Hanning window, not rectangular. Try adding window=mlab.window_none to the call. (Sorry, I meant to mention that before in my reply. Ryan -- Ryan May Graduate Research Assistant School of Meteorology University of Oklahoma This e-mail and any files transmitted with it may be proprietary and are intended solely for the use of the individual or entity to whom they are addressed. If you have received this e-mail in error please notify the sender. Please note that any views or opinions presented in this e-mail are solely those of the author and do not necessarily represent those of ITT Corporation. The recipient should check this e-mail and any attachments for the presence of viruses. ITT accepts no liability for any damage caused by any virus transmitted by this e-mail. |
|
From: Roy H. H. <sta...@gm...> - 2008-12-08 13:55:46
|
Cool! Thanks. pyplot.subplots_adjust seems to be some kind of "super" function that controls margins for the entire figure as well as spacing between the subplots. On Mon, Dec 8, 2008 at 1:32 AM, Pierre GM <pgm...@gm...> wrote: > > On Dec 8, 2008, at 1:09 AM, Roy H. Han wrote: > > > I figured it out. > > Specifically, I need to use pylab.Axes(figure, [left, bottom, width, > > height]) where each value in the frame is between 0 and 1 > > [.2,.1,.7,.8] > > means > > 20 percent margin on left > > 10 percent margin on bottom > > 10 percent margin on right (1 - .2 - .7) > > 10 percent margin on top (1 - .1 - .8) > > > Yep, you got it. > Now, you can also use the simpler `pyplot.subplots_adjust` as a > function, or as a method for your figure. That way, you're not tied to > defining the positions at the creation of your subplot. > > > > > ------------------------------------------------------------------------------ > SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada. > The future of the web can't happen without you. Join us at MIX09 to help > pave the way to the Next Web now. Learn more and register at > > http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
|
From: Mauro C. <mau...@gm...> - 2008-12-08 13:33:20
|
Dear Jeff, 2008/12/8 Jeff Whitaker <js...@fa...>: > Mauro: I realized that this is actually possible with the Cassini > projection (the transverse aspect of the cylindrical equidistant). > > Don't know why you would actually do it though, if you want to show polar > regions you should probably use the polar stereographic maps (npstere, > spstere). I had not yet had time to try Cassini's before receiving your posting. As Scott already pointed out, no doubt the polar projections are more adequate to representing the poles (pretty obvious!). I just intended to try making the most parsimonious use of the Basemap parameters :-). The polar stereographic are nice, but what about the polar azimuthal, that also look good? Just curious. Best regards, -- Dr. Mauro J. Cavalcanti Ecoinformatics Studio P.O. Box 46521, CEP 20551-970 Rio de Janeiro, RJ, BRASIL E-mail: mau...@gm... Web: http://studio.infobio.net Linux Registered User #473524 * Ubuntu User #22717 "Life is complex. It consists of real and imaginary parts." |
|
From: Mauro C. <mau...@gm...> - 2008-12-08 13:22:10
|
Dear Jeff, 2008/12/8 Jeff Whitaker <js...@fa...>: > Mauro: I just updated SVN basemap so you can specify just lon_0 for all > cylindrical projections (cyl,gall,merc,mill) to get a global map centered on > lon_0 (implying > llcrnrlat=-90,urcrnrlat=90,llcrnrlon=lon_0-180,urcrnrlon=lon_0+180). Excellent! Will however have to change my Basemap installation to the SVN repository. > No. Cylindrical projections can't cross the poles. Just figured this out, by trial-and-error. BTW, these explorations led me to comment that biogeographers (almost all of them biologists like myself) have seldom (or never!) paid attention to the question of map projections! This by itself should merit a scientific paper! So, Basemap may also be lending to scientific insights... Exciting, isn't it? More soon.... ;-) Best wishes, -- Dr. Mauro J. Cavalcanti Ecoinformatics Studio P.O. Box 46521, CEP 20551-970 Rio de Janeiro, RJ, BRASIL E-mail: mau...@gm... Web: http://studio.infobio.net Linux Registered User #473524 * Ubuntu User #22717 "Life is complex. It consists of real and imaginary parts." |
|
From: Jeff W. <js...@fa...> - 2008-12-08 13:13:21
|
Mauro Cavalcanti wrote:
> Dear Jeff,
>
> 2008/12/7 Jeff Whitaker <js...@fa...>:
>
>> Mauro: Just set the llrncrlat,urcrnrlon appropriately. For instance,
>> llcrnrlon=0, urcrnrlon=360 will produce a map centered on the dateline while
>> llcrnrlon=-180, urcrnrlon=180 will produce a map centered on Greenwich.
>>
>
> Thanks! I had not figured out that the decimal coordinates used by
> Basemap range from 0 to 360 (and not just from -180 to 180). Using
> this tip, I could also create a map centered on the Indian Ocean. BTW,
> by varying the llcrnrlat and urcrnrlat, can one also create maps
> centered on the North and South poles using a Equirectangular
> projection?
>
Mauro: I realized that this is actually possible with the Cassini
projection (the transverse aspect of the cylindrical equidistant).
from mpl_toolkits.basemap import Basemap
import matplotlib.pyplot as plt
width=20000000
m = Basemap(lon_0=0,lat_0=0,projection='cass',\
width=0.75*width,height=2*width)
m.drawcoastlines()
m.fillcontinents(color='coral',lake_color='aqua')
m.drawparallels(range(-80,81,21))
m.drawmeridians(range(-180,181,60))
m.drawmapboundary(fill_color='aqua')
plt.show()
Don't know why you would actually do it though, if you want to show
polar regions you should probably use the polar stereographic maps
(npstere, spstere).
-Jeff
> With best regards,
>
>
--
Jeffrey S. Whitaker Phone : (303)497-6313
NOAA/OAR/CDC R/PSD1 FAX : (303)497-6449
325 Broadway Boulder, CO, USA 80305-3328
|
|
From: Jeff W. <js...@fa...> - 2008-12-08 12:53:57
|
Mauro Cavalcanti wrote: > Dear Jeff, > > 2008/12/7 Jeff Whitaker <js...@fa...>: > >> Mauro: Just set the llrncrlat,urcrnrlon appropriately. For instance, >> llcrnrlon=0, urcrnrlon=360 will produce a map centered on the dateline while >> llcrnrlon=-180, urcrnrlon=180 will produce a map centered on Greenwich. >> > > Thanks! I had not figured out that the decimal coordinates used by > Basemap range from 0 to 360 (and not just from -180 to 180). Mauro: I just updated SVN basemap so you can specify just lon_0 for all cylindrical projections (cyl,gall,merc,mill) to get a global map centered on lon_0 (implying llcrnrlat=-90,urcrnrlat=90,llcrnrlon=lon_0-180,urcrnrlon=lon_0+180). > Using > this tip, I could also create a map centered on the Indian Ocean. BTW, > by varying the llcrnrlat and urcrnrlat, can one also create maps > centered on the North and South poles using a Equirectangular > projection? > No. Cylindrical projections can't cross the poles. -Jeff > With best regards, > > -- Jeffrey S. Whitaker Phone : (303)497-6313 NOAA/OAR/CDC R/PSD1 FAX : (303)497-6449 325 Broadway Boulder, CO, USA 80305-3328 |
|
From: Mauro C. <mau...@gm...> - 2008-12-08 12:14:50
|
Dear Jeff, 2008/12/7 Jeff Whitaker <js...@fa...>: > Mauro: Just set the llrncrlat,urcrnrlon appropriately. For instance, > llcrnrlon=0, urcrnrlon=360 will produce a map centered on the dateline while > llcrnrlon=-180, urcrnrlon=180 will produce a map centered on Greenwich. Thanks! I had not figured out that the decimal coordinates used by Basemap range from 0 to 360 (and not just from -180 to 180). Using this tip, I could also create a map centered on the Indian Ocean. BTW, by varying the llcrnrlat and urcrnrlat, can one also create maps centered on the North and South poles using a Equirectangular projection? With best regards, -- Dr. Mauro J. Cavalcanti Ecoinformatics Studio P.O. Box 46521, CEP 20551-970 Rio de Janeiro, RJ, BRASIL E-mail: mau...@gm... Web: http://studio.infobio.net Linux Registered User #473524 * Ubuntu User #22717 "Life is complex. It consists of real and imaginary parts." |
|
From: Pierre GM <pgm...@gm...> - 2008-12-08 06:32:55
|
On Dec 8, 2008, at 1:09 AM, Roy H. Han wrote: > I figured it out. > Specifically, I need to use pylab.Axes(figure, [left, bottom, width, > height]) where each value in the frame is between 0 and 1 > [.2,.1,.7,.8] > means > 20 percent margin on left > 10 percent margin on bottom > 10 percent margin on right (1 - .2 - .7) > 10 percent margin on top (1 - .1 - .8) Yep, you got it. Now, you can also use the simpler `pyplot.subplots_adjust` as a function, or as a method for your figure. That way, you're not tied to defining the positions at the creation of your subplot. |
|
From: Roy H. H. <sta...@gm...> - 2008-12-08 06:09:24
|
I figured it out.
Specifically, I need to use pylab.Axes(figure, [left, bottom, width,
height]) where each value in the frame is between 0 and 1
[.2,.1,.7,.8]
means
20 percent margin on left
10 percent margin on bottom
10 percent margin on right (1 - .2 - .7)
10 percent margin on top (1 - .1 - .8)
figure = pylab.figure()
axes = pylab.Axes(figure, [.2,.1,.7,.8]) # [left, bottom, width, height]
where each value is between 0 and 1
figure.add_axes(axes)
axes.barh(selectedFeatureNumbers, alphas, align='center')
axes.set_xlabel('Weights set by ViolaJones')
axes.set_title(title)
axes.set_yticks(selectedFeatureNumbers)
axes.set_yticklabels([dictionary[x][0] for x in selectedFeatureNumbers])
for tick in axes.yaxis.get_major_ticks(): tick.label1.set_fontsize(6)
pylab.savefig('%s.png' % title)
On Mon, Dec 8, 2008 at 12:56 AM, Roy H. Han <
sta...@gm...> wrote:
> Hi,
>
> Is there a way to increase the left-margin of pylab plots? Specifically
> I'm trying to make enough space so that the text labels on the left are
> visible. I tried decreasing the font size of the labels but it isn't
> enough.
>
> Thanks,
> RHH
>
|
|
From: Roy H. H. <sta...@gm...> - 2008-12-08 05:56:05
|
Hi, Is there a way to increase the left-margin of pylab plots? Specifically I'm trying to make enough space so that the text labels on the left are visible. I tried decreasing the font size of the labels but it isn't enough. Thanks, RHH |
|
From: Elfnor <el...@gm...> - 2008-12-08 01:00:17
|
Thomas Pfaff-3 wrote: > > Hi, > > does that mean that it works for you with PyScripter? > Right now the only way to do more than one plot with MPL with PyScripter > is > to reinitialize the remote python interpreter over and over again. > If you found a way around that I would be glad to hear about it. > > ... > I can get two plots from Pyscripter as follows: Find out where your matplotlibrc file is >>> import matplotlib >>>matplotlib.get_configdir() 'H:\\.matplotlib' edit the matplotlib file in this directory (or copy the example from the matplotlib site)to set interactive to True and the backend to one of the Tk or wx options: backend : WXAgg ... interactive : True # see http://matplotlib.sourceforge.net/interactive.html make sure there is no # at the front of the interactive line Choose the matching external Python Engine in PyScripter ie. Run>Python Engine > Remote (Wx) Then this example should give two interactive plots: >>> import pylab >>> pylab.figure(1) >>> pylab.plot([1,2,3]) >>> pylab.xlabel('X label for 1st plot') >>> pylab.figure(2) >>> pylab.plot([10,20,30]) >>> pylab.xlabel('X label for 2nd plot') go back and add a y label to the first plot >>> pylab.figure(1) >>> pylab.ylabel('Y label for 1st plot') -- View this message in context: http://www.nabble.com/Can-matplotlib-be-run-from-PythonWin-IDE-in-interactive-mode--tp20822638p20888060.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
|
From: Jeff W. <js...@fa...> - 2008-12-08 00:37:25
|
Mauro Cavalcanti wrote: > Dear Jeffrey, > > 2008/12/6 Jeff Whitaker <js...@fa...>: > > >> Mauro: There never actually was a Basemap 0.90 - could you check that >> version number again with >> > > Sorry, my reference to a "0.90" version was a typo! Indeed, I have version 0.99 > > Thanks for the information on the drawing of rivers; I will see how I > can provide this feature to users, warning them that the first plot > may take some time to complete. > > BTW, even if there are reasons for the slowness of river plotting and > Blue Marble superimposition, have you any information on the most > appropriate hardware requirements for getting the fastest plots in > these cases? > Mauro: All I can say is, the faster the better. > As of volunteers for helping with the Basemap documentation, count me > in, just after I have my current project finished (hopefully by the > next month). One idea I have is creating a "Basemap Cookbook" website, > essentially presenting all the examples included in the current > distribution, plus a few others (as the additional example for > plotting shapefiles that you posted on the list a few days ago). > Great. -Jeff > With warmest regards, > > -- Jeffrey S. Whitaker Phone : (303)497-6313 NOAA/OAR/CDC R/PSD1 FAX : (303)497-6449 325 Broadway Boulder, CO, USA 80305-3328 |
|
From: Jeff W. <js...@fa...> - 2008-12-08 00:36:35
|
Mauro Cavalcanti wrote: > Dear Jeffrey & ALL, > > Are there any way to plot a Basemap using a standard Equidistant > Cylindrical Projection, but centered on the Pacific Basin instead of > the default plot? This can be done easily with all projections that > require just a center point at lat_0, long_0 (Robinson, Mollweide, > Orthographic, Geostationary) but could not figure out how to do this > in projections that require a bounding rectangle to be defined (as is > the case with the Equidistant Cylindrical). > > Thanks in advance! > > With best regards, > > Mauro: Just set the llrncrlat,urcrnrlon appropriately. For instance, llcrnrlon=0, urcrnrlon=360 will produce a map centered on the dateline while llcrnrlon=-180, urcrnrlon=180 will produce a map centered on Greenwich. -Jeff -- Jeffrey S. Whitaker Phone : (303)497-6313 NOAA/OAR/CDC R/PSD1 FAX : (303)497-6449 325 Broadway Boulder, CO, USA 80305-3328 |
|
From: Mauro C. <mau...@gm...> - 2008-12-07 22:25:51
|
Dear Jeffrey & ALL, Are there any way to plot a Basemap using a standard Equidistant Cylindrical Projection, but centered on the Pacific Basin instead of the default plot? This can be done easily with all projections that require just a center point at lat_0, long_0 (Robinson, Mollweide, Orthographic, Geostationary) but could not figure out how to do this in projections that require a bounding rectangle to be defined (as is the case with the Equidistant Cylindrical). Thanks in advance! With best regards, -- Dr. Mauro J. Cavalcanti Ecoinformatics Studio P.O. Box 46521, CEP 20551-970 Rio de Janeiro, RJ, BRASIL E-mail: mau...@gm... Web: http://studio.infobio.net Linux Registered User #473524 * Ubuntu User #22717 "Life is complex. It consists of real and imaginary parts." |
|
From: Mauro C. <mau...@gm...> - 2008-12-07 21:27:26
|
Dear Jeffrey, 2008/12/6 Jeff Whitaker <js...@fa...>: > Mauro: There never actually was a Basemap 0.90 - could you check that > version number again with Sorry, my reference to a "0.90" version was a typo! Indeed, I have version 0.99 Thanks for the information on the drawing of rivers; I will see how I can provide this feature to users, warning them that the first plot may take some time to complete. BTW, even if there are reasons for the slowness of river plotting and Blue Marble superimposition, have you any information on the most appropriate hardware requirements for getting the fastest plots in these cases? As of volunteers for helping with the Basemap documentation, count me in, just after I have my current project finished (hopefully by the next month). One idea I have is creating a "Basemap Cookbook" website, essentially presenting all the examples included in the current distribution, plus a few others (as the additional example for plotting shapefiles that you posted on the list a few days ago). With warmest regards, -- Dr. Mauro J. Cavalcanti Ecoinformatics Studio P.O. Box 46521, CEP 20551-970 Rio de Janeiro, RJ, BRASIL E-mail: mau...@gm... Web: http://studio.infobio.net Linux Registered User #473524 * Ubuntu User #22717 "Life is complex. It consists of real and imaginary parts." |
|
From: B C. <clo...@ya...> - 2008-12-07 15:24:31
|
"""
Show how to use a lasso to select a set of points and get the indices
of the selected points. A callback is used to change the color of the
selected points
This is currently a proof-of-concept implementation (though it is
usable as is). There will be some refinement of the API and the
inside polygon detection routine.
"""
from matplotlib.widgets import Lasso
import matplotlib.mlab
from matplotlib.nxutils import points_inside_poly
from matplotlib.colors import colorConverter
from matplotlib.collections import RegularPolyCollection
from matplotlib.pyplot import figure, show
from numpy import nonzero
from numpy.random import rand
class Datum:
colorin = colorConverter.to_rgba('red')
colorout = colorConverter.to_rgba('green')
def __init__(self, x, y, include=False):
self.x = x
self.y = y
if include: self.color = self.colorin
else: self.color = self.colorout
class LassoManager:
def __init__(self, ax, data):
self.axes = ax
self.canvas = ax.figure.canvas
self.data = data
#the lasso lock boolean is used to tell whether another
#widget event has priority
self.lassoLock = False
self.Nxy = len(data)
facecolors = [d.color for d in data]
self.xys = [(d.x, d.y) for d in data]
fig = ax.figure
self.collection = RegularPolyCollection(
fig.dpi, 6, sizes=(100,),
facecolors=facecolors,
offsets = self.xys,
transOffset = ax.transData)
ax.add_collection(self.collection)
self.cid = self.canvas.mpl_connect('button_press_event', self.onpress)
self.cidRelease = self.canvas.mpl_connect('button_release_event', self.onrelease)
self.ind = None
def callback(self, verts):
facecolors = self.collection.get_facecolors()
ind = nonzero(points_inside_poly(self.xys, verts))[0]
for i in range(self.Nxy):
if i in ind:
facecolors[i] = Datum.colorin
else:
facecolors[i] = Datum.colorout
self.canvas.draw_idle()
self.canvas.widgetlock.release(self.lasso)
#del self.lasso
self.ind = ind
def onpress(self, event):
if self.canvas.widgetlock.locked(): return
if event.inaxes is None: return
self.lasso = Lasso(event.inaxes, (event.xdata, event.ydata), self.callback)
# acquire a lock on the widget drawing
self.canvas.widgetlock(self.lasso)
# establish boolean that can be used to release the widgetlock
self.lassoLock = True
def onrelease(self, event):
'on release we reset the press data'
# test whether the widgetlock was initiated by the lasso
if self.lassoLock:
self.canvas.widgetlock.release(self.lasso)
self.lassoLock = False
print self.ind
if __name__ == '__main__':
data = [Datum(*xy) for xy in rand(100, 2)]
fig = figure()
ax = fig.add_subplot(111, xlim=(0,1), ylim=(0,1), autoscale_on=False)
lman = LassoManager(ax, data)
show()
|
|
From: Jeff W. <js...@fa...> - 2008-12-06 13:57:29
|
Mauro Cavalcanti wrote: > Dear ALL, > > I am using Basemap version 0.90 with MPL version 0.98.3 under Linux > Ubuntu, both installed from Andrew Straw repository (I just prefer to > install from repositories via apt than directly from the sources, > although in this case I do not have always the latest versions). > Mauro: There never actually was a Basemap 0.90 - could you check that version number again with >>> from mpl_toolkits.basemap import __version__ >>> print __version__ 0.99.2 See below for my comment on the speed of drawing rivers .. > I stumbled upon a few issues that I could not solve by looking at the > available documentation. They are not really critical for me, but I > would be interested in finding some more about them anyway. > > Here they are: > > i) When trying some of the projections listed in the Basemap > documentation, I got a message saying that this or that projection is > not available, what leads me to think that these projections have only > been included in later versions of Basemap. However, I could not find > this in the documentation. This is not critical for my current > project, as I have no need to offer so many projections, but I would > like to know. > > ii) The plotting of rivers using the drawrivers() method is painfully > slow, even with resolution set to "crude". The FAQ provided with the > Basemap source package offers an interesting suggestion for > potentially solving this, but an exemple would be in order (the FAQ > mentions an "ireland.py" example which I have however not found in the > examples directory). > Looked into this a bit and found that drawing rivers the first time is slow, since the reading and processing of the river data is deferred until the drawrivers method is called. In contrast, the coastlines are read and processed on instance creation. I did this because most people don't use the river data, and I didn't want to impose that penalty on them on instance creation. Subsequent calls to drawrivers (with the same Basemap instance) are very fast. -Jeff > iii) In the same context as the above, I would be interested in > knowing if there is some way to speed up the plotting of a map with > the Blue Marble image superimposed on it. > > In general, I would like to suggest that the Basemap FAQ could be > expanded and made available in the website, along with, perhaps, some > the examples provided in the Basemap distribution package (in the same > way the examples are provided in the MPL page). > > Well, hope this helps! > > Have a nice weekend. > > With best regards, > > -- Jeffrey S. Whitaker Phone : (303)497-6313 NOAA/OAR/CDC R/PSD1 FAX : (303)497-6449 325 Broadway Boulder, CO, USA 80305-3328 |
|
From: Sunnje L B. <Sun...@nf...> - 2008-12-06 13:33:59
|
Hi, does anyone know if there is something like matlabs 'axis ij' in matplotlib? I'm often plotting data from the water column where the xaxis should be on top of the plot and the yaxis should be reversed. Sünnje |
|
From: Thomas P. <ya...@gm...> - 2008-12-06 12:14:04
|
Hi, does that mean that it works for you with PyScripter? Right now the only way to do more than one plot with MPL with PyScripter is to reinitialize the remote python interpreter over and over again. If you found a way around that I would be glad to hear about it. To the rest: Might there be a way to mimick IPython's behavior of 'creating separate threads' (or whatever it might be that makes IPython do the trick) while importing matplotlib? IPython is great but having an editor/integrated debugger with all the other goodies that PyScripter offers PLUS interactive matplotlib-plotting would be even greater... Cheers, Thomas ----- Original Message ----- From: "Elfnor" <el...@gm...> To: <mat...@li...> Sent: Wednesday, December 03, 2008 11:05 PM Subject: [Matplotlib-users] Can matplotlib be run from PythonWin IDE ininteractive mode? > > Hi > > I'm giving an introductory talk on matplotlib to colleagues next week. I'd > like to run matplotlib in interactive mode from the PythonWin IDE. Is this > possible? > > I use PyScripter or occasionally IPython myself, but the python group I'm > talking to have all been set up with PythonWin and my brief is to avoid > confusing then with another IDE. > > thanks Eleanor > -- > View this message in context: > http://www.nabble.com/Can-matplotlib-be-run-from-PythonWin-IDE-in-interactive-mode--tp20822638p20822638.html > Sent from the matplotlib - users mailing list archive at Nabble.com. > > > > |
|
From: Jeff W. <js...@fa...> - 2008-12-06 01:26:09
|
Mauro Cavalcanti wrote: > Dear ALL, > > I am using Basemap version 0.90 with MPL version 0.98.3 under Linux > Ubuntu, both installed from Andrew Straw repository (I just prefer to > install from repositories via apt than directly from the sources, > although in this case I do not have always the latest versions). > > I stumbled upon a few issues that I could not solve by looking at the > available documentation. They are not really critical for me, but I > would be interested in finding some more about them anyway. > > Here they are: > > i) When trying some of the projections listed in the Basemap > documentation, I got a message saying that this or that projection is > not available, what leads me to think that these projections have only > been included in later versions of Basemap. However, I could not find > this in the documentation. This is not critical for my current > project, as I have no need to offer so many projections, but I would > like to know. > Mauro: Yes, the documentation applies to the current SVN version. Version 0.90 is rather old now. > ii) The plotting of rivers using the drawrivers() method is painfully > slow, even with resolution set to "crude". The FAQ provided with the > Basemap source package offers an interesting suggestion for > potentially solving this, but an exemple would be in order (the FAQ > mentions an "ireland.py" example which I have however not found in the > examples directory). > I haven't noticed the rivers being slow, but I'll look into it. > iii) In the same context as the above, I would be interested in > knowing if there is some way to speed up the plotting of a map with > the Blue Marble image superimposed on it. > Plotting the blue marble image involves interpolating a very large array from lat/lon coordinates to projection coordinates. So, no - there is no easy way to speed it up. If you're only using a few different map projections and regions, you could pickle those basemap instances and re-use them, thereby saving the interpolation cost. Using the "cyl" projection is reasonably fast, since there is no interpolation. > In general, I would like to suggest that the Basemap FAQ could be > expanded and made available in the website, along with, perhaps, some > the examples provided in the Basemap distribution package (in the same > way the examples are provided in the MPL page). > I try to expand the docs in my spare time, which I haven't had much of lately. Volunteers are welcome! -Jeff > Well, hope this helps! > > Have a nice weekend. > > With best regards, > > -- Jeffrey S. Whitaker Phone : (303)497-6313 NOAA/OAR/CDC R/PSD1 FAX : (303)497-6449 325 Broadway Boulder, CO, USA 80305-3328 |
|
From: Mauro C. <mau...@gm...> - 2008-12-06 00:25:22
|
Dear ALL, I am using Basemap version 0.90 with MPL version 0.98.3 under Linux Ubuntu, both installed from Andrew Straw repository (I just prefer to install from repositories via apt than directly from the sources, although in this case I do not have always the latest versions). I stumbled upon a few issues that I could not solve by looking at the available documentation. They are not really critical for me, but I would be interested in finding some more about them anyway. Here they are: i) When trying some of the projections listed in the Basemap documentation, I got a message saying that this or that projection is not available, what leads me to think that these projections have only been included in later versions of Basemap. However, I could not find this in the documentation. This is not critical for my current project, as I have no need to offer so many projections, but I would like to know. ii) The plotting of rivers using the drawrivers() method is painfully slow, even with resolution set to "crude". The FAQ provided with the Basemap source package offers an interesting suggestion for potentially solving this, but an exemple would be in order (the FAQ mentions an "ireland.py" example which I have however not found in the examples directory). iii) In the same context as the above, I would be interested in knowing if there is some way to speed up the plotting of a map with the Blue Marble image superimposed on it. In general, I would like to suggest that the Basemap FAQ could be expanded and made available in the website, along with, perhaps, some the examples provided in the Basemap distribution package (in the same way the examples are provided in the MPL page). Well, hope this helps! Have a nice weekend. With best regards, -- Dr. Mauro J. Cavalcanti Ecoinformatics Studio P.O. Box 46521, CEP 20551-970 Rio de Janeiro, RJ, BRASIL E-mail: mau...@gm... Web: http://studio.infobio.net Linux Registered User #473524 * Ubuntu User #22717 "Life is complex. It consists of real and imaginary parts." |
|
From: Jeff W. <js...@fa...> - 2008-12-05 22:38:04
|
Mauro Cavalcanti wrote:
> Dear Jeff,
>
> Sorry, I then got a TypeError: remove() takes exactly one argument (0
> given)... :-(
>
> Best regards,
>
Mauro: Don't know why that would be. Here's what I get
% ipython --pylab
In [3] from mpl_toolkits.basemap import Basemap
In [4]: m = Basemap()
In [5]: c = m.drawcountries() # map pops up with country boundaries drawn
In [6]: type(c)
Out[6]: <class 'matplotlib.collections.LineCollection'>
In [7]: help(c.remove)
Help on method remove in module matplotlib.artist:
remove(self) method of matplotlib.collections.LineCollection instance
Remove the artist from the figure if possible. The effect
will not be visible until the figure is redrawn, e.g., with
:meth:`matplotlib.axes.Axes.draw_idle`. Call
:meth:`matplotlib.axes.Axes.relim` to update the axes limits
if desired.
In [8]: c.remove()
In [9]: draw() # countries disappear from map.
-Jeff
> 2008/12/5 Jeff Whitaker <js...@fa...>:
>
>> Mauro Cavalcanti wrote:
>>
>>> Dear Jeff,
>>>
>>> Thanks for your fast reply. Unfortunately, I have not been able to get
>>> yet working:
>>>
>>> I have a menu event like this:
>>>
>>> borders = []
>>> if self.MapDrawBorderItem.IsChecked():
>>> borders = self.map.drawcountries()
>>> else:
>>> self.ax.lines.remove(borders)
>>> # .... redraw the map here...
>>>
>>> But I got a ValueError: list.remove(x): x not in list
>>>
>>> Any hints?
>>>
>>>
>> Mauro: Instead of
>>
>> self.ax.lines.remove(borders)
>>
>> I think should simply do
>>
>> borders.remove()
>>
>> -Jeff
>>
>>> With best regards,
>>>
>>> 2008/12/5 Jeff Whitaker <js...@fa...>:
>>>
>>>
>>>> Mauro Cavalcanti wrote:
>>>>
>>>>
>>>>> Dear ALL,
>>>>>
>>>>> Always engaged in pushing MPL/Basemap ahead of its limits, here am I
>>>>> again with a humble question: I want to be able to toggle the display
>>>>> of country boundaries on a map using a menu option on my wxPython
>>>>> interface. It is quite easy to initially plotting a map without
>>>>> borders and then toggling them on, but I could not figure out a way to
>>>>> toggling them off (if possible, without redrawing the whole map). Is
>>>>> there any trick to do this? ;-)
>>>>>
>>>>> Thanks in advance!
>>>>>
>>>>> With warmest regards,
>>>>>
>>>>>
>>>>>
>>>>>
>>>> Mauro:
>>>>
>>>> The drawcountries() method returns a matplotlib line collection.
>>>> Invoking
>>>> the remove() method of the line collection will remove the countries from
>>>> the axes instance.
>>>>
>>>> -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
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>>
>> --
>> 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
>>
>>
>>
>
>
>
>
--
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
|