SourceForge logo
SourceForge logo
Menu

matplotlib-users — Discussion related to using matplotlib

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
2
(2)
3
(16)
4
(22)
5
(7)
6
7
(9)
8
(2)
9
10
(7)
11
(15)
12
(7)
13
(4)
14
(7)
15
(3)
16
(6)
17
(20)
18
(18)
19
(15)
20
(27)
21
(14)
22
23
(1)
24
(18)
25
(22)
26
(36)
27
(17)
28
(6)
29
(2)
30
(3)
31
(6)





Showing 18 results of 18

From: Christopher B. <Chr...@no...> - 2010年05月24日 23:12:58
Jeff Whitaker wrote:
> On 5/24/10 10:24 AM, Christopher Barker wrote:
>> I need to be able to draw a filled polygon from coordinates in memory,
>> for instance, but didn't see a way to do this directly.
> Chris: If you have the map projection coordinates of the polygon,
nope -- we've got lat-long
> you 
> can just use the pyplot commands or axes methods, and then use the 
> Basemap set_axes_limits method to make sure the aspect ratio and axes 
> limits get reset correctly.
I'll look into that too -- if I have time.
Thanks,
 -Chris
-- 
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chr...@no...
From: Eric F. <ef...@ha...> - 2010年05月24日 19:11:13
On 04/09/2010 06:44 AM, Mathew Yeates wrote:
> Can anyone verify this? If so, I'll submit it to the tracker.
>
> The following works without the --pylab switch but not with it. The error I
> get is some how related to a call to get the active figure which returns
> None.
>
> C:\Python26\lib\site-packages\mpl_toolkits\basemap\__init__.pyc in
> set_axes_limi
> ts(self, ax)
> 2531 if is_interactive():
> 2532 figManager = _pylab_helpers.Gcf.get_active()
> -> 2533 figManager.canvas.draw()
>
> AttributeError:'NoneType' object has no attribute'canvas'.
>
> In the following code. the error happens at
> m.drawcoastlines()
>
> Help?
Mathew,
Going back through my email stack I found your message. Testing on my 
machine, using mpl and basemap from svn, and using "ipython --pylab", I 
don't see any error. The code that you show having raised the exception 
no longer exists--there is no longer any reference to _pylab_helpers--so 
I think the problem has been solved.
Eric
>
> ===============================================
> from mpl_toolkits.basemap import Basemap, shiftgrid
> import numpy as np
> import matplotlib.pyplot as plt
> from matplotlib.backends.backend_gtkagg import \
> FigureCanvasGTKAgg as FigureCanvas
> import gtk
>
> # create new figure
> #fig=plt.figure()
> from matplotlib.figure import Figure
> fig = Figure(figsize=(5,5), dpi=100)
> canvas = FigureCanvas(fig)
> window = gtk.Window(gtk.WINDOW_TOPLEVEL)
> window.add(canvas)
> # setup cylindrical equidistant map projection (global domain).
> ax = fig.add_axes([0.1,0.1,0.7,0.7])
> m = Basemap(llcrnrlon=-180.,llcrnrlat=-90,urcrnrlon=180.,urcrnrlat=90.,\
> resolution='c',area_thresh=10000.,projection='cyl',ax=ax)
> m.drawcoastlines()
> m.tissot(-117,34,10,10)
> #plt.show()
> canvas.show()
> window.show()
>
From: Eric F. <ef...@ha...> - 2010年05月24日 18:48:44
On 05/24/2010 07:08 AM, Dharhas Pothina wrote:
> Hi,
>
> I'm trying to use plot_date to plot some USGS daily flow data. I seem to have hit a bug in the plotting where large spikes in data are not being plotted at all scales.
>
It's the known path simplification bug, which has been fixed in svn. If 
you can't run an mpl built from svn, the workaround is to turn off path 
simplification, e.g.
rcParams['path.simplify'] = False
or the equivalent in the matplotlibrc file.
Eric
From: Eric F. <ef...@ha...> - 2010年05月24日 18:43:48
On 05/24/2010 07:43 AM, Jeff Whitaker wrote:
> On 5/24/10 10:09 AM, P. R.M. wrote:
>> Hi,
>> Im trying to create a precipitation contour plot using imshow() and
>> basemap.
>> Id like to draw the imshow() plot so that it overlays the filled
>> continents, yet NOT the continental outlines.
>> unfortunately, it appears that imshow()'s graphics are always drawn
>> before everything else, so its 'zorder' argument is useless with basemap.
>> the imshow() output is always at the bottom layer, with everthing else
>> being overlaid on it & covering it up.
>>
>> is there a work-around for this, so that I can layer imshow()'s output
>> between my calls to 'basemap.fillcontinents()' and
>> 'basemap.drawcoastlines()'???
>>
>> please help,
>>
>> thanks,
>> p.romero
>
> I don't think this is possible - zorder doesn't work with images. You
> can use transparency though.
Zorder works with images in svn, but maybe this change was after the 
last release.
Eric
From: P. R.M. <rom...@ho...> - 2010年05月24日 18:42:47
Jeff,
would it be possible to achieve this type of layering using 
multiple overlaid (sub) plots?
If so, how would I go about this?
 Send
do you know of any way I 
might be able to create a custom 'hack' into the imshow code (within the
 matplotlib core) ???
thanks again, 
p.romero
Date: 2010年5月24日 11:43:04 -0600
From: js...@fa...
Subject: Re: [Matplotlib-users] setting zorder for basemap.imshow();	overlay on continents
To: rom...@ho...; mat...@li...
 
 
On 5/24/10 10:09 AM, P. R.M. wrote:
 Hi,
Im trying to create a precipitation contour plot using imshow() and
basemap.
Id like to draw the imshow() plot so that it overlays the filled
continents, yet NOT the continental outlines.
unfortunately, it appears that imshow()'s graphics are always drawn
before everything else, so its 'zorder' argument is useless with
basemap.
the imshow() output is always at the bottom layer, with everthing else
being overlaid on it & covering it up.
 
is there a work-around for this, so that I can layer imshow()'s output
between my calls to 'basemap.fillcontinents()' and
'basemap.drawcoastlines()'??? 
 
please help,
 
thanks,
p.romero
I don't think this is possible - zorder doesn't work with images. You
can use transparency though.
-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
 		 	 		 
_________________________________________________________________
The New Busy is not the old busy. Search, chat and e-mail from your inbox.
http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_3 
From: P. R.M. <rom...@ho...> - 2010年05月24日 18:42:14
hello,
please ignore my last response; I responded to the wrong mailing list message...
From: rom...@ho...
To: js...@fa...; chr...@no...; mat...@li...
Date: 2010年5月24日 13:10:23 -0500
Subject: Re: [Matplotlib-users] [matplotlib-devel] basemap domain	changes	on	pyplot call
Jeff,
would it be possible to achieve this type of layering using multiple overlaid (sub) plots?
If so, how would I go about this?
 Send
do you know of any way I might be able to create a custom 'hack' into the imshow code (within the matplotlib core) ???
thanks again, 
p.romero
> Date: 2010年5月24日 11:44:53 -0600
> From: js...@fa...
> To: Chr...@no...; mat...@li...
> Subject: Re: [Matplotlib-users] [matplotlib-devel] basemap domain changes	on	pyplot call
> 
> On 5/24/10 10:24 AM, Christopher Barker wrote:
> > Benjamin Root wrote:
> > 
> >> On Fri, May 21, 2010 at 5:16 PM, Jeff Whitaker<js...@fa...
> >> Ben: That's why you should use the basemap methods where possible
> >> (they handle these things for you).
> >>
> >>
> >> Yeah, that wasn't possible in my case. In addition, not all pyplot
> >> plotting functions are available (nor do I expect Basemap to have all of
> >> them available).
> >> 
> > Though it would be nice to add more as we need them. I assume Jeff will
> > take contributions.
> >
> > I need to be able to draw a filled polygon from coordinates in memory,
> > for instance, but didn't see a way to do this directly. If I get a
> > chance, I will look into .drawshapefile(), and figure I can see how to
> > do it from there.
> >
> > -Chris
> >
> >
> >
> > 
> Chris: If you have the map projection coordinates of the polygon, you 
> can just use the pyplot commands or axes methods, and then use the 
> Basemap set_axes_limits method to make sure the aspect ratio and axes 
> limits get reset correctly.
> 
> -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
> 
> 
> ------------------------------------------------------------------------------
> 
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
 		 	 		 
Hotmail has tools for the New Busy. Search, chat and e-mail from your inbox. Learn more. 		 	 		 
_________________________________________________________________
Hotmail has tools for the New Busy. Search, chat and e-mail from your inbox.
http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_1 
On 05/24/2010 04:55 AM, Benjamin Root wrote:
>
> On Thu, May 20, 2010 at 1:06 AM, ayuffa <ay...@gm...
> <mailto:ay...@gm...>> wrote:
>
>
> Does anyone have another fix for this problem that DOES NOT produce HUGE
> PDF/EPS files?
>
> I believe that the latest SVN revision should allow you to set
> rasterized=True for the call to contourf. I don't know if the relevant
> code has been checked in or not. This should help with producing pdf
> files (and theoretically, eps files, although that backend might need
> some more work...).
The OP's problem is caused by a path simplification bug that is fixed in 
svn, so if the OP can build mpl from svn, then there is no need to turn 
on rasterization.
Eric
>
> Ben Root
>
>
>
> ------------------------------------------------------------------------------
>
>
>
>
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: P. R.M. <rom...@ho...> - 2010年05月24日 18:10:31
Jeff,
would it be possible to achieve this type of layering using multiple overlaid (sub) plots?
If so, how would I go about this?
do you know of any way I might be able to create a custom 'hack' into the imshow code (within the matplotlib core) ???
thanks again, 
p.romero
> Date: 2010年5月24日 11:44:53 -0600
> From: js...@fa...
> To: Chr...@no...; mat...@li...
> Subject: Re: [Matplotlib-users] [matplotlib-devel] basemap domain changes	on	pyplot call
> 
> On 5/24/10 10:24 AM, Christopher Barker wrote:
> > Benjamin Root wrote:
> > 
> >> On Fri, May 21, 2010 at 5:16 PM, Jeff Whitaker<js...@fa...
> >> Ben: That's why you should use the basemap methods where possible
> >> (they handle these things for you).
> >>
> >>
> >> Yeah, that wasn't possible in my case. In addition, not all pyplot
> >> plotting functions are available (nor do I expect Basemap to have all of
> >> them available).
> >> 
> > Though it would be nice to add more as we need them. I assume Jeff will
> > take contributions.
> >
> > I need to be able to draw a filled polygon from coordinates in memory,
> > for instance, but didn't see a way to do this directly. If I get a
> > chance, I will look into .drawshapefile(), and figure I can see how to
> > do it from there.
> >
> > -Chris
> >
> >
> >
> > 
> Chris: If you have the map projection coordinates of the polygon, you 
> can just use the pyplot commands or axes methods, and then use the 
> Basemap set_axes_limits method to make sure the aspect ratio and axes 
> limits get reset correctly.
> 
> -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
> 
> 
> ------------------------------------------------------------------------------
> 
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
 		 	 		 
_________________________________________________________________
Hotmail has tools for the New Busy. Search, chat and e-mail from your inbox.
http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_1 
From: Jeff W. <js...@fa...> - 2010年05月24日 17:51:53
On 5/24/10 8:45 AM, Benjamin Root wrote:
>
>
> On Fri, May 21, 2010 at 5:16 PM, Jeff Whitaker <js...@fa... 
> <mailto:js...@fa...>> wrote:
>
>
> On 5/21/10 3:57 PM, Benjamin Root wrote:
>> I did some more digging and I think I have a hypothesis for what
>> is happening.
>>
>> There is only one main difference between a call to .drawstates()
>> and .readshapefiles() with respect to loading and plotting data. 
>> .drawstates() loads *only* the line segments that coincide with
>> the defined map boundaries, while .readshapefiles() loads all of
>> the data in the shapefile. Therefore, the LineCollection that
>> gets attached to the axis contains data from outside the stated
>> domain.
>>
>> In addition, the basemap versions of the plotting functions have
>> the benefit of finishing their calls with a call to
>> .set_axes_limits(), which keeps the axes in check. However, a
>> non-basemap version would not call that automatically, thereby
>> having its axes automatically expanded to contain all of the data
>> in the LineCollection.
>>
>> I am not sure what exactly should be done about this. This is
>> certainly un-intuitive behavior, though. Maybe there could be a
>> keyword option in .readshapefile() to have only the data for the
>> stated domain loaded? That might solve the issue.
>>
>> Thanks,
>> Ben Root
>
> Ben: That's why you should use the basemap methods where possible
> (they handle these things for you).
>
>
> Yeah, that wasn't possible in my case. In addition, not all pyplot 
> plotting functions are available (nor do I expect Basemap to have all 
> of them available). Therefore, it often makes more sense for me to 
> use the pyplot functions and just give Basemap the axes.
>
> You could also turn autoscaling off on your axes using
>
> ax.set_autoscaleon(False)
>
> and then they won't automatically expand when you plot data
> outside your map region. Or, you could just call the
> set_axes_limits() methods before you draw the plot.
>
> At the least, I think this advice should be thoroughly documented, 
> especially in the docstring for readshapefile(). This behavior was 
> quite perplexing to me and it took a while to figure out the cause. I 
> am one of those people who will not leave well enough alone...
>
>
> Clipping the polygons to the map projection region is non-trivial,
> and I don't think I want to add that to readshapefile.
>
> Personally, I think there should be a family of .draw*() functions 
> that behave like .drawstates(). One of those functions can be 
> .drawshapefile(). Then there would be a family of .read*() functions 
> that could be called either by the user or by the .draw*() functions. 
> The .read*() function could have an option to perform a clip of the 
> incoming data.
>
> If you like to discuss this further, I would be more than happy to 
> help out.
>
> Ben Root
Ben: The shapefile stuff in Basemap certainly could use some work. If 
you'd like to help, that would be great.
-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: Jeff W. <js...@fa...> - 2010年05月24日 17:44:59
On 5/24/10 10:24 AM, Christopher Barker wrote:
> Benjamin Root wrote:
> 
>> On Fri, May 21, 2010 at 5:16 PM, Jeff Whitaker<js...@fa...
>> Ben: That's why you should use the basemap methods where possible
>> (they handle these things for you).
>>
>>
>> Yeah, that wasn't possible in my case. In addition, not all pyplot
>> plotting functions are available (nor do I expect Basemap to have all of
>> them available).
>> 
> Though it would be nice to add more as we need them. I assume Jeff will
> take contributions.
>
> I need to be able to draw a filled polygon from coordinates in memory,
> for instance, but didn't see a way to do this directly. If I get a
> chance, I will look into .drawshapefile(), and figure I can see how to
> do it from there.
>
> -Chris
>
>
>
> 
Chris: If you have the map projection coordinates of the polygon, you 
can just use the pyplot commands or axes methods, and then use the 
Basemap set_axes_limits method to make sure the aspect ratio and axes 
limits get reset correctly.
-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: Jeff W. <js...@fa...> - 2010年05月24日 17:43:10
On 5/24/10 10:09 AM, P. R.M. wrote:
> Hi,
> Im trying to create a precipitation contour plot using imshow() and 
> basemap.
> Id like to draw the imshow() plot so that it overlays the filled 
> continents, yet NOT the continental outlines.
> unfortunately, it appears that imshow()'s graphics are always drawn 
> before everything else, so its 'zorder' argument is useless with basemap.
> the imshow() output is always at the bottom layer, with everthing else 
> being overlaid on it & covering it up.
>
> is there a work-around for this, so that I can layer imshow()'s output 
> between my calls to 'basemap.fillcontinents()' and 
> 'basemap.drawcoastlines()'???
>
> please help,
>
> thanks,
> p.romero
I don't think this is possible - zorder doesn't work with images. You 
can use transparency though.
-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: Dharhas P. <Dha...@tw...> - 2010年05月24日 17:08:53
Attachments: 08176500.zip
Hi,
I'm trying to use plot_date to plot some USGS daily flow data. I seem to have hit a bug in the plotting where large spikes in data are not being plotted at all scales.
For example in the attached data file there is a spike in the flow that hits a maximum of 30700 on 1998年10月20日. When plotted with the commands below this portion of the dataset does not show up. If I drag the plot window to make the x axis 2 to 3 times wider than normal there is point at which this data spike suddenly appears. This problem doesn't exist if I use a symbol like .,+ etc only with lines.
code:
----
import datetime
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
qfile = '08176500.txt'
#q_file = qfile.split('.')[0].split('\\')[-1]
q_ts = np.genfromtxt(qfile,comments='#',dtype=None,usecols=(2,3),names='dates,discharge')
dt = np.array([datetime.date(year=int(date.split('-')[0]), month=int(date.split('-')[1]), day=int(date.split('-')[2])) for date in q_ts['dates']])
fig = plt.figure()
ax = fig.add_subplot(111)
ax.plot_date(mpl.dates.date2num(dt), q_ts['discharge'],'-')
plt.show()
----
Any help is appreciated.
thanks,
- dharhas
From: Christopher B. <Chr...@no...> - 2010年05月24日 16:24:27
Benjamin Root wrote:
> On Fri, May 21, 2010 at 5:16 PM, Jeff Whitaker <js...@fa... 
> Ben: That's why you should use the basemap methods where possible
> (they handle these things for you).
> 
> 
> Yeah, that wasn't possible in my case. In addition, not all pyplot 
> plotting functions are available (nor do I expect Basemap to have all of 
> them available).
Though it would be nice to add more as we need them. I assume Jeff will 
take contributions.
I need to be able to draw a filled polygon from coordinates in memory, 
for instance, but didn't see a way to do this directly. If I get a 
chance, I will look into .drawshapefile(), and figure I can see how to 
do it from there.
-Chris
-- 
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chr...@no...
From: P. R.M. <rom...@ho...> - 2010年05月24日 16:09:51
Hi,
Im trying to create a precipitation contour plot using imshow() and basemap.
Id like to draw the imshow() plot so that it overlays the filled continents, yet NOT the continental outlines.
unfortunately, it appears that imshow()'s graphics are always drawn before everything else, so its 'zorder' argument is useless with basemap.
the imshow() output is always at the bottom layer, with everthing else being overlaid on it & covering it up.
is there a work-around for this, so that I can layer imshow()'s output between my calls to 'basemap.fillcontinents()' and 'basemap.drawcoastlines()'??? 
please help,
thanks,
p.romero
 		 	 		 
_________________________________________________________________
Hotmail has tools for the New Busy. Search, chat and e-mail from your inbox.
http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_1 
From: Pau <vim...@go...> - 2010年05月24日 15:40:48
Dear all,
I am producing some plots and in many of them I have in the y-axis typically
0.00001 0.00003 ... 0.00009
In previous versions of matplotlib this would go into a
1, 3 .... 9
and then a x10^-4
close to the top. This was very nice.
This feature seems to be lost, at least with the defaults.
How can I reset this?
I would also like to know how to specify the number of ticks to be
used for an axis.
Thanks,
Pau
On Thu, May 20, 2010 at 1:06 AM, ayuffa <ay...@gm...> wrote:
>
> Does anyone have another fix for this problem that DOES NOT produce HUGE
> PDF/EPS files?
>
> I believe that the latest SVN revision should allow you to set
rasterized=True for the call to contourf. I don't know if the relevant code
has been checked in or not. This should help with producing pdf files (and
theoretically, eps files, although that backend might need some more
work...).
Ben Root
From: Benjamin R. <ben...@ou...> - 2010年05月24日 14:45:33
On Fri, May 21, 2010 at 5:16 PM, Jeff Whitaker <js...@fa...> wrote:
>
> On 5/21/10 3:57 PM, Benjamin Root wrote:
>
> I did some more digging and I think I have a hypothesis for what is
> happening.
>
> There is only one main difference between a call to .drawstates() and
> .readshapefiles() with respect to loading and plotting data. .drawstates()
> loads *only* the line segments that coincide with the defined map
> boundaries, while .readshapefiles() loads all of the data in the shapefile.
> Therefore, the LineCollection that gets attached to the axis contains data
> from outside the stated domain.
>
> In addition, the basemap versions of the plotting functions have the
> benefit of finishing their calls with a call to .set_axes_limits(), which
> keeps the axes in check. However, a non-basemap version would not call that
> automatically, thereby having its axes automatically expanded to contain all
> of the data in the LineCollection.
>
> I am not sure what exactly should be done about this. This is certainly
> un-intuitive behavior, though. Maybe there could be a keyword option in
> .readshapefile() to have only the data for the stated domain loaded? That
> might solve the issue.
>
> Thanks,
> Ben Root
>
>
> Ben: That's why you should use the basemap methods where possible (they
> handle these things for you).
>
Yeah, that wasn't possible in my case. In addition, not all pyplot plotting
functions are available (nor do I expect Basemap to have all of them
available). Therefore, it often makes more sense for me to use the pyplot
functions and just give Basemap the axes.
> You could also turn autoscaling off on your axes using
>
> ax.set_autoscaleon(False)
>
> and then they won't automatically expand when you plot data outside your
> map region. Or, you could just call the set_axes_limits() methods before
> you draw the plot.
>
> At the least, I think this advice should be thoroughly documented,
especially in the docstring for readshapefile(). This behavior was quite
perplexing to me and it took a while to figure out the cause. I am one of
those people who will not leave well enough alone...
Clipping the polygons to the map projection region is non-trivial, and I
> don't think I want to add that to readshapefile.
>
> Personally, I think there should be a family of .draw*() functions that
behave like .drawstates(). One of those functions can be .drawshapefile().
Then there would be a family of .read*() functions that could be called
either by the user or by the .draw*() functions. The .read*() function
could have an option to perform a clip of the incoming data.
If you like to discuss this further, I would be more than happy to help out.
Ben Root
From: Fredrik P. <pi....@gm...> - 2010年05月24日 14:04:58
Hi,
My boss asked me to provide a list of the source-code distribution per
folder in a project.
Using cloc http://cloc.sourceforge.net/ and some python give me all the numbers.
The problem comes when using pie to display the result, since many folders have
a small distribution, labels are printed ontop of each other making it
impossible to
read.
Using linux-2.6.34 kernel as an example:
----8<----
#!/usr/bin/env python
from pylab import *
#linux-2.6.34
dirs=['arch', 'block', 'crypto', 'Documentation', 'drivers',
'firmware', 'fs', 'include', 'init', 'ipc', 'kernel', 'lib', 'mm',
'net', 'samples', 'scripts', 'security', 'sound', 'tools', 'usr',
'virt']
result=[8433016,1662987,11234,38484,44922,4596534,2048,678518,255574,2289,5478,102723,22516,46726,425009,625,31712,31006,440266,29128,549,3973]
fracs=[100*i/float(result[0]) for i in result[1:]]
#difficult to see all the pie-elements,
for f,l in zip(fracs,dirs):
 print l.rjust(20),round(f,2),'\t%'
# make a square figure and axes
figure(1, figsize=(8,8))
ax = axes([0.1, 0.1, 0.8, 0.8])
p=pie(fracs, labels=dirs)
show()
----8<----
some googling gives this thread:
http://www.mail-archive.com/mat...@li.../msg16191.html
but that doesn't solve the problem, just makes it different...
Anyone know of a solution to this problem?
cheers
//Fredrik

Showing 18 results of 18

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /