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

Showing 13 results of 13

From: Andrea G. <and...@gm...> - 2007年06月01日 21:52:26
Hi John,
On 5/31/07, John Hunter wrote:
> On 5/31/07, Andrea Gavana <and...@gm...> wrote:
> > Hi All,
> >
> > I am writing an application (wxPython based) which embeds a big
> > matplotlib figure as a main panel. Basically, this app shows oil well
> > producers and gas injectors on a 2D map as dots (every dot represents
> > its surface location), and a bunch of "streamlines" (i.e., straight
> > lines or simple curves) which connect injectors and producers.
> > As the numerical simulation continues, more and more streamlines are
> > added to the plot (because of new wells or because interference
> > between wells), and actually I end up having 200 dots plus 800-1200
> > lines. As the simulation progresses, the plots become slower and
> > slower...
> > As the lines are usually 2-points straight lines, I was thinking about
> > using Line Collections; however, every matplotlib line has a linewidth
> > value that is dependent on the calculated "interference" effect
> > between wells, which means I have to build a matplotlib line for every
> > line connecting an injector with a producer. Moreover, every injector
> > well has its own colour for the streamlines (there are 33 injector
> > wells).
> > Will Line Collections save some time in this case? If not, does anyone
> > have a suggestion on how I could try to speed-up the plotting? I am
> > not really familiar with some obscure line/axes properties, so I may
> > have overlooked something.
>
> Yes, a line collection will save you a lot of time with upwards of
> 1000 line segments. This is the use case they were designed to solve:
> a bunch of segments of differing widths and colors. One could
> optimize it for the special case of simple line segments, ie [(x1,y1),
> (x2, y2)] in which case we could use numpy arrays, but currently we
> have only the general case of a collection of arbitrary length
> segments, and since they are not necessarily the same length, we use a
> sequence of segments rather than an array, and this is slower than it
> could be.
I managed to get things twice faster than before using Line
Collections (even though some more optimization can be done). However,
I am facing a problem with the legend: as I put all the lines in a
single collection, and I don't want all the lines to be marked in the
legend but only the ones with biggest linewidth for every injector
well, how do I get a particular line of the collection in order to
legend() that line only? I didn't find any method or attribute about
that. Maybe it is just plain impossible.
Thank you for every hint.
Andrea.
"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.virgilio.it/infinity77/
From: Andrew S. <str...@as...> - 2007年06月01日 20:38:00
bre...@un... wrote:
>
> Hi Alan,
>
> I'm not speaking for anyone else, but as far as I'm concerned that
> code is public domain.
>
OK, well, who wrote the code and who holds the copyright? In other
words, your concerns about the code being in the public domain may or
may not be relevant, depending on where the code came from and whether
you have any legal authority to distribute the code and under what
conditions. It would be nice to include an SG filter in scipy, for
example, but that would only be possible if it were released under a
BSD-like license.
-Andrew
From: Gregor T. <Gre...@ui...> - 2007年06月01日 19:55:35
John Pye schrieb:
> Hi all
> 
> Can anyone tell me whether or not it is straightforward to run
> matplotlib on OpenSUSE 10.2?
> 
> My project has a dependency on matplotlib and I have a user on that
> platform who tells me that it's not available as an RPM in the SUSE
> repository. Can that really be true?
On
http://software.opensuse.org/download/science/openSUSE_10.2/
there is a quite recent RPM (and also of numpy, scipy, etc)
Gregor
From: Iyer <mas...@ya...> - 2007年06月01日 19:44:13
Hello,
I was wondering if it would be possible to draw a
vertical line in a subplot, in such a way that the
line exactly covers top to bottom of the subplot, say
- if the subplot has a height of 80 points, the
vertical line's length will be 80 points. Also, this
vertical line may have an horizontal line that starts
from it for a given length. like this |-------------;
| being the vertical line and ------------ being the
horizontal line. 
Is there any way to implement this in Matplotlib. It'd
also be nice to have a text annotating the horizontal
and vertical line, something like this:
 
-------------------------------------------------------
 |	 |					|
 |annotation1 |---------------------------- 	|
subplot 	 
 | 	|					|
 |	 |					|
 |	 |					|
 
-------------------------------------------------------
There likely will be 3-4 subplots like the above in a
figure. The 3-4 subplots contain a plot of some data.
In effect, it is like placing an annotation on the
subplot data with a marker that illustrates the data
position where the annotation is, and the length of
the marker that specifies how long the portion of data
on the plot the annotation runs.
Here's a snippet I wrote, but it doesn't cover the
height of the subplot fully, it takes xycoords as
'data'. 
 self.axes.annotate("annotation1",
xy=(locn,ytextlocn), xycoords='data', color='brown',
 
markerprops=dict(marker='|', markerfacecolor='black',
markersize=94, markeredgecolor='black',
 markeredgewidth
= 2),
 )
 self.axes.annotate("annotation1", xy=(locn,
ytextlocn), xycoords='data', color='brown', 
 
markerprops=dict(marker=TICKRIGHT,
markerfacecolor='black',
markersize=(length_of_annotation1),
 
 markeredgecolor='black', markeredgewidth = 2),
 
horizontalalignment='right', verticalalignment='top',
 )
What could be the best way to avoid annotations from
overlapping in the plot? 
I guess this is kind of a complicated question. Please
let me know if I wasn't sufficiently clear. I'm new to
Mpl, and I may have overlooked something, or I may be
doing something wrong.
 ____________________________________________________________________________________
Luggage? GPS? Comic books? 
Check out fitting gifts for grads at Yahoo! Search
http://search.yahoo.com/search?fr=oni_on_mail&p=graduation+gifts&cs=bz
From: Andrea G. <and...@gm...> - 2007年06月01日 19:29:41
Hi John,
On 5/31/07, John Hunter wrote:
> On 5/31/07, Andrea Gavana <and...@gm...> wrote:
> > Hi All,
> >
> > I am writing an application (wxPython based) which embeds a big
> > matplotlib figure as a main panel. Basically, this app shows oil well
> > producers and gas injectors on a 2D map as dots (every dot represents
> > its surface location), and a bunch of "streamlines" (i.e., straight
> > lines or simple curves) which connect injectors and producers.
> > As the numerical simulation continues, more and more streamlines are
> > added to the plot (because of new wells or because interference
> > between wells), and actually I end up having 200 dots plus 800-1200
> > lines. As the simulation progresses, the plots become slower and
> > slower...
> > As the lines are usually 2-points straight lines, I was thinking about
> > using Line Collections; however, every matplotlib line has a linewidth
> > value that is dependent on the calculated "interference" effect
> > between wells, which means I have to build a matplotlib line for every
> > line connecting an injector with a producer. Moreover, every injector
> > well has its own colour for the streamlines (there are 33 injector
> > wells).
> > Will Line Collections save some time in this case? If not, does anyone
> > have a suggestion on how I could try to speed-up the plotting? I am
> > not really familiar with some obscure line/axes properties, so I may
> > have overlooked something.
>
> Yes, a line collection will save you a lot of time with upwards of
> 1000 line segments. This is the use case they were designed to solve:
> a bunch of segments of differing widths and colors. One could
> optimize it for the special case of simple line segments, ie [(x1,y1),
> (x2, y2)] in which case we could use numpy arrays, but currently we
> have only the general case of a collection of arbitrary length
> segments, and since they are not necessarily the same length, we use a
> sequence of segments rather than an array, and this is slower than it
> could be.
Thank you for your answer. I am going to try to build these line
collections and see what I can get. I never used them before so it's
like I will get something not very well performing at first...
Thank you for your answer, I am going to look at some examples...
Andrea.
"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.virgilio.it/infinity77/
From: Matthew A. <ma...@ph...> - 2007年06月01日 17:17:05
I think we want to keep matplotlib associated with the OS X Framework 
install of python; if we installed the macports version, am I correct in 
assuming that we could just dump the resulting python modules (eg. gtk, 
tkinter, and matplotlib) into the Framework install's site-packages dir 
(or more likely my own PYTHONPATH dir) and disregard the macports distro 
of python?
On Fri, 1 Jun 2007, Jochen Küpper wrote:
> On 31.05.2007, at 20:34, Jeff Whitaker wrote:
>
>> The fink matplotlib package uses GTKAgg as the default backend, and
>> works fine over an ssh tunnel. The admin will have to:
>> 
>> 0) make sure X11.app (and the X11 SDK) is installed.
>> 1) install fink
>> 2) run 'fink selfupdate'
>> 3) run 'fink install matplotlib-py25' (and wait a few hours for
>> everything to compile).
>
> Same holds for MacPorts -- it has matplotlib in variants tk, gtk2, and 
> wxPython.
>
> I guess in your case you would need to convince yur Admin to install 
> MacPorts, or install as a normal user, which might work -- that would then 
> include gtk2 or wxWidgets as necessary.
>
> Greetings,
> Jochen
>
From: Jeff W. <js...@fa...> - 2007年06月01日 16:52:14
Jesper Larsen wrote:
> Hi matplotlib users,
>
> I have a small web application for calculating tsunami travel times 
> (http://ocean.dmi.dk/apps/tsunami). The application uses matplotlib/basemap 
> for producing contour maps of the tsunami travel times.
>
> To speed up the response time of the application I made a version in which the 
> calculations are performed for every second integer longitude and latitude 
> for calculation windows of 60x60 degrees lon x lat, 90x90, 180x180 and 
> global. This is a lot of plots for which I am making a new Basemap instances 
> for each plot since:
>
> llcrnrlon
> llcrnrlat
> urcrnrlon
> urcrnrlat
>
> differs for each plot. The initialization of the Basemap instances are 
> responsible for the vast majority of the CPU usage in the application.
>
> In converting the application to numpy (from numarray) I was wondering whether 
> I could reduce the plotting time as well. Is it possible to reuse a Basemap 
> instance somehow in my case or is that out of the question?
>
> Regards,
> Jesper
>
> 
Jesper: Here's a better way, that allows you to label the meridians and 
parallels. It will only work for projection='cyl', although a similar 
solution could be worked up for 'merc' and 'mill'.
from matplotlib.toolkits.basemap import Basemap
import pylab as p
def resetmapbounds(map,llcrnrlon,llcrnrlat,urcrnrlon,urcrnrlat):
 map.llcrnrlat = llcrnrlat; map.llcrnrlon = llcrnrlon
 map.urcrnrlat = urcrnrlat; map.urcrnrlon = urcrnrlon
 map.llcrnry = map.llcrnrlat; map.llcrnrx=map.llcrnrlon
 map.urcrnry = map.urcrnrlat; map.urcrnrx=map.urcrnrlon
 return map
fig = p.figure()
# create the Basemap instance
map = Basemap()
map.fillcontinents(color='coral')
map.drawparallels(p.arange(-90,91,30),labels=[1,1,1,1])
map.drawmeridians(p.arange(-180,181,30),labels=[1,1,1,1])
#p.savefig('fig1.png')
# resuse the Basemap instance, resetting the lat/lon domain.
# US Domain.
fig = p.figure()
map = resetmapbounds(map,-140,20,-65,55)
map.fillcontinents(color='coral')
map.drawparallels(p.arange(-90,91,10),labels=[1,1,1,1])
map.drawmeridians(p.arange(-180,181,10),labels=[1,1,1,1])
#p.savefig('fig2.png')
# Europe Domain.
fig = p.figure()
map = resetmapbounds(map,-20,30,40,80)
map.fillcontinents(color='coral')
map.drawparallels(p.arange(-90,91,10),labels=[1,1,1,1])
map.drawmeridians(p.arange(-180,181,10),labels=[1,1,1,1])
#p.savefig('fig3.png')
p.show()
HTH,
-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-124
Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg
From: Gary R. <gr...@bi...> - 2007年06月01日 14:03:41
Many thanks for the special case code Jeff,
This appears to work well.
I see you picked up on our confusion about the -180 to 180 longitude 
range. I'll pass this on and look at clipping the lines outside the 
circle later,
regards,
Gary
Jeff Whitaker wrote:
> gr...@bi... wrote:
>> I've been trying to help a friend who wants to plot directional data 
>> on a "Wulff net" 
>> <http://en.wikipedia.org/wiki/Pole_figure#Geometry_in_the_pole_figure>, 
>> which is a stereographic projection plot. She wants to plot points 
>> specified by latitude and longitude in degrees. We hoped to be able to 
>> use the basemap toolkit's "stere" plot, centred at lat_0=0, lon_0=0, 
>> with limits set at +/-90deg lat and +/-180deg lon, but we keep getting 
>> tracebacks and I wondered whether this is possible, based on a comment 
>> from Jeff Whitaker 
>> <http://www.nabble.com/-basemap--stereographic-projection-bounding-boxes-tf2170166.html#a6000978> 
>> which implies that basemap's stereographic projection code can't 
>> handle these default limits. Is this the case? Would it be asking too 
>> much to request a small sample of generating some Wulff-net axes? 
>> Plotting points on these seems simple enough. We started with the 
>> polarmaps.py example and the code below is as close as we could get. 
>> Any suggestions would be welco
>> me.
>>
>> Gary Ruben
>>
>> -- 
>>
>> from matplotlib.toolkits.basemap import Basemap
>> from pylab import *
>>
>> # loop over projections, one for each panel of the figure.
>> fig = figure(figsize=(4,4))
>> # setup map projection
>> m = 
>> Basemap(projection='stere',lat_0=0.,lon_0=0.,llcrnrlat=-50.,llcrnrlon=-120., 
>> urcrnrlat=90., urcrnrlon=90.)
>> ax = fig.add_subplot(1,1,1)
>> # draw parallels and meridians.
>> m.drawparallels(arange(-180.,180.,10.))
>> m.drawmeridians(arange(-90.,90.,10.))
>> # draw boundary around map region.
>> m.drawmapboundary()
>> show()
>>
>>
>> -
> Gary:
> 
> How about this?
> 
> import pylab as p
> from matplotlib.toolkits.basemap import Basemap
> from matplotlib.patches import Circle, Polygon
> w=25483988.0
> map = Basemap(lon_0=0,lat_0=0,projection='stere',width=w,height=w)
> print map.llcrnrlat,map.llcrnrlon,map.urcrnrlat,map.urcrnrlon
> map.drawparallels(p.arange(-80,81,10))
> map.drawmeridians(p.arange(-90,91,10))
> ax = p.gca()
> circ = Circle(map(0,0),0.5*w)
> circ.set_fill(False)
> circ.set_edgecolor('k')
> circ.set_linewidth(1.0)
> circ.set_clip_on(True)
> ax.add_patch(circ)
> #ax.set_frame_on(False)
> p.show()
> 
> It should be possible to get rid of the lines extending outside the 
> circular region by filling the region between the circle and the 
> bounding square.
> 
> HTH,
> 
> -Jeff
From: Jeff W. <js...@fa...> - 2007年06月01日 12:06:45
Jesper Larsen wrote:
> Hi matplotlib users,
>
> I have a small web application for calculating tsunami travel times 
> (http://ocean.dmi.dk/apps/tsunami). The application uses matplotlib/basemap 
> for producing contour maps of the tsunami travel times.
>
> To speed up the response time of the application I made a version in which the 
> calculations are performed for every second integer longitude and latitude 
> for calculation windows of 60x60 degrees lon x lat, 90x90, 180x180 and 
> global. This is a lot of plots for which I am making a new Basemap instances 
> for each plot since:
>
> llcrnrlon
> llcrnrlat
> urcrnrlon
> urcrnrlat
>
> differs for each plot. The initialization of the Basemap instances are 
> responsible for the vast majority of the CPU usage in the application.
>
> In converting the application to numpy (from numarray) I was wondering whether 
> I could reduce the plotting time as well. Is it possible to reuse a Basemap 
> instance somehow in my case or is that out of the question?
>
> Regards,
> Jesper
>
> 
Jesper: As long as you are using the cylindrical equidistant 
projection, something like this might work:
from matplotlib.toolkits.basemap import Basemap
import pylab as p
map = Basemap()
map.fillcontinents(color='coral')
map.drawparallels(p.arange(-90,91,30))
map.drawmeridians(p.arange(-180,181,30))
p.savefig('fig1.png')
ax = p.gca()
llcrnrlat = 20
llcrnrlon = -140
urcrnrlat = 55
urcrnrlon = -65
corners = ((llcrnrlon,llcrnrlat), (urcrnrlon,urcrnrlat))
ax.update_datalim( corners )
ax.set_xlim((llcrnrlon, urcrnrlon))
ax.set_ylim((llcrnrlat, urcrnrlat))
p.savefig('fig2.png')
llcrnrlat = 30
llcrnrlon = -20
urcrnrlat = 80
urcrnrlon = 50
corners = ((llcrnrlon,llcrnrlat), (urcrnrlon,urcrnrlat))
ax.update_datalim( corners )
ax.set_xlim((llcrnrlon, urcrnrlon))
ax.set_ylim((llcrnrlat, urcrnrlat))
p.savefig('fig3.png')
You might not be able to get labels on the meridians and parallels with 
this approach though.
-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: Jeff W. <js...@fa...> - 2007年06月01日 11:49:05
gr...@bi... wrote:
> I've been trying to help a friend who wants to plot directional data on=
 a "Wulff net" <http://en.wikipedia.org/wiki/Pole_figure#Geometry_in_the_=
pole_figure>, which is a stereographic projection plot. She wants to plot=
 points specified by latitude and longitude in degrees. We hoped to be ab=
le to use the basemap toolkit's "stere" plot, centred at lat_0=3D0, lon_0=
=3D0, with limits set at +/-90deg lat and +/-180deg lon, but we keep gett=
ing tracebacks and I wondered whether this is possible, based on a commen=
t from Jeff Whitaker <http://www.nabble.com/-basemap--stereographic-proje=
ction-bounding-boxes-tf2170166.html#a6000978> which implies that basemap'=
s stereographic projection code can't handle these default limits. Is thi=
s the case? Would it be asking too much to request a small sample of gene=
rating some Wulff-net axes? Plotting points on these seems simple enough.=
 We started with the polarmaps.py example and the code below is as close =
as we could get. Any suggestions would be welco
> me.
>
> Gary Ruben
>
> --
>
> from matplotlib.toolkits.basemap import Basemap
> from pylab import *
>
> # loop over projections, one for each panel of the figure.
> fig =3D figure(figsize=3D(4,4))
> # setup map projection
> m =3D Basemap(projection=3D'stere',lat_0=3D0.,lon_0=3D0.,llcrnrlat=3D-5=
0.,llcrnrlon=3D-120., urcrnrlat=3D90., urcrnrlon=3D90.)
> =20
> ax =3D fig.add_subplot(1,1,1)
> # draw parallels and meridians.
> m.drawparallels(arange(-180.,180.,10.))
> m.drawmeridians(arange(-90.,90.,10.))
> # draw boundary around map region.
> m.drawmapboundary()
> show()
>
>
> -
Gary:
How about this?
import pylab as p
from matplotlib.toolkits.basemap import Basemap
from matplotlib.patches import Circle, Polygon
w=3D25483988.0
map =3D Basemap(lon_0=3D0,lat_0=3D0,projection=3D'stere',width=3Dw,height=
=3Dw)
print map.llcrnrlat,map.llcrnrlon,map.urcrnrlat,map.urcrnrlon
map.drawparallels(p.arange(-80,81,10))
map.drawmeridians(p.arange(-90,91,10))
ax =3D p.gca()
circ =3D Circle(map(0,0),0.5*w)
circ.set_fill(False)
circ.set_edgecolor('k')
circ.set_linewidth(1.0)
circ.set_clip_on(True)
ax.add_patch(circ)
#ax.set_frame_on(False)
p.show()
It should be possible to get rid of the lines extending outside the=20
circular region by filling the region between the circle and the=20
bounding square.
HTH,
-Jeff
--=20
Jeffrey S. Whitaker Phone : (303)497-6313
NOAA/OAR/CDC R/PSD1 FAX : (303)497-6449
325 Broadway Boulder, CO, USA 80305-3328
From: Jesper L. <jl...@dm...> - 2007年06月01日 09:56:06
Hi matplotlib users,
I have a small web application for calculating tsunami travel times 
(http://ocean.dmi.dk/apps/tsunami). The application uses matplotlib/basemap 
for producing contour maps of the tsunami travel times.
To speed up the response time of the application I made a version in which the 
calculations are performed for every second integer longitude and latitude 
for calculation windows of 60x60 degrees lon x lat, 90x90, 180x180 and 
global. This is a lot of plots for which I am making a new Basemap instances 
for each plot since:
llcrnrlon
llcrnrlat
urcrnrlon
urcrnrlat
differs for each plot. The initialization of the Basemap instances are 
responsible for the vast majority of the CPU usage in the application.
In converting the application to numpy (from numarray) I was wondering whether 
I could reduce the plotting time as well. Is it possible to reuse a Basemap 
instance somehow in my case or is that out of the question?
Regards,
Jesper
From: <jo...@fh...> - 2007年06月01日 07:54:45
Attachments: PGP.sig
On 31.05.2007, at 20:34, Jeff Whitaker wrote:
> The fink matplotlib package uses GTKAgg as the default backend, and
> works fine over an ssh tunnel. The admin will have to:
>
> 0) make sure X11.app (and the X11 SDK) is installed.
> 1) install fink
> 2) run 'fink selfupdate'
> 3) run 'fink install matplotlib-py25' (and wait a few hours for
> everything to compile).
Same holds for MacPorts -- it has matplotlib in variants tk, gtk2, =20
and wxPython.
I guess in your case you would need to convince yur Admin to install =20
MacPorts, or install as a normal user, which might work -- that would =20=
then include gtk2 or wxWidgets as necessary.
Greetings,
Jochen
--=20
Einigkeit und Recht und Freiheit http://www.Jochen-=20
Kuepper.de
 Libert=E9, =C9galit=E9, Fraternit=E9 GnuPG key: =
CC1B0B4D
 Sex, drugs and rock-n-roll
From: <gr...@bi...> - 2007年06月01日 04:19:12
I've been trying to help a friend who wants to plot directional data on a "Wulff net" <http://en.wikipedia.org/wiki/Pole_figure#Geometry_in_the_pole_figure>, which is a stereographic projection plot. She wants to plot points specified by latitude and longitude in degrees. We hoped to be able to use the basemap toolkit's "stere" plot, centred at lat_0=0, lon_0=0, with limits set at +/-90deg lat and +/-180deg lon, but we keep getting tracebacks and I wondered whether this is possible, based on a comment from Jeff Whitaker <http://www.nabble.com/-basemap--stereographic-projection-bounding-boxes-tf2170166.html#a6000978> which implies that basemap's stereographic projection code can't handle these default limits. Is this the case? Would it be asking too much to request a small sample of generating some Wulff-net axes? Plotting points on these seems simple enough. We started with the polarmaps.py example and the code below is as close as we could get. Any suggestions would be welcome.
Gary Ruben
--
from matplotlib.toolkits.basemap import Basemap
from pylab import *
# loop over projections, one for each panel of the figure.
fig = figure(figsize=(4,4))
# setup map projection
m = Basemap(projection='stere',lat_0=0.,lon_0=0.,llcrnrlat=-50.,llcrnrlon=-120., urcrnrlat=90., urcrnrlon=90.)
 
ax = fig.add_subplot(1,1,1)
# draw parallels and meridians.
m.drawparallels(arange(-180.,180.,10.))
m.drawmeridians(arange(-90.,90.,10.))
# draw boundary around map region.
m.drawmapboundary()
show()

Showing 13 results of 13

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 によって変換されたページ (->オリジナル) /