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
(7) |
|
2
(5) |
3
(18) |
4
(9) |
5
(13) |
6
(14) |
7
(8) |
8
(7) |
|
9
(6) |
10
(6) |
11
(24) |
12
(14) |
13
(9) |
14
(21) |
15
(6) |
|
16
(1) |
17
(20) |
18
(42) |
19
(16) |
20
(21) |
21
(41) |
22
(13) |
|
23
(11) |
24
(15) |
25
(32) |
26
(27) |
27
(29) |
28
(10) |
29
(3) |
|
30
(1) |
31
(5) |
|
|
|
|
|
|
From: Michael H. <mh...@us...> - 2008-03-03 23:49:20
|
Jeff - That would replicate the "simple" scale-bar from GMT. Below
is my not-complete attempt at replicating the "fancy" scale bar. It
would need some options for specifying different units (miles,
nautical miles, etc.) and perhaps some more attention to spacing of
the text from the scale bar and tick marks...
--Mike
from numpy import *
from matplotlib.toolkits.basemap import Basemap, pyproj
from pylab import *
# add drawscale method to Basemap class.
class Basemap2(Basemap):
def drawscale(self,lon,lat,length,yoffset=None):
"""draw a fancy map scale from lon-length/2,lat-yoffset to
lon-length/2,lat-yoffset, label it with actual distance in km"""
length = length*1000 #input length is km
#we need 5 sets of x coordinates (in map units)
#center of scale
xc,yc = self(lon,lat)
#left edge of scale
lon1,lat1 = self(xc-length/2,yc,inverse=True)
x1,y1 = self(lon1,lat1)
#quarter scale
lon2,lat2 = self(xc-length/4,yc,inverse=True)
x2,y2 = self(lon2,lat2)
#three quarter scale
lon3,lat3 = self(xc+length/4,yc,inverse=True)
x3,y3 = self(lon3,lat3)
#right edge of scale
lon4,lat4 = self(xc+length/2,yc,inverse=True)
x4,y4 = self(lon4,lat4)
if yoffset is None: yoffset = 0.1*length
#plot top line
ytop = yc+yoffset/2
ybottom = yc-yoffset/2
ytick = ybottom - yoffset/2
ytext = ytick - yoffset/2
m.plot([x1,x4],[ytop,ytop],color='k')
#plot bottom line
m.plot([x1,x4],[ybottom,ybottom],color='k')
#plot left edge
m.plot([x1,x1],[ybottom,ytop],color='k')
#plot right edge
m.plot([x4,x4],[ybottom,ytop],color='k')
#make a filled black box from left edge to 1/4 way across
fill([x1,x2,x2,x1,x1],[ytop,ytop,ybottom,ybottom,ytop],'k')
#make a filled white box from 1/4 way across to 1/2 way across
fill([x2,xc,xc,x2,x2],[ytop,ytop,ybottom,ybottom,ytop],'w')
#make a filled white box from 1/2 way across to 3/4 way across
fill([xc,x3,x3,xc,xc],[ytop,ytop,ybottom,ybottom,ytop],'k')
#make a filled white box from 3/4 way across to end
fill([x3,x4,x4,x3,x3],[ytop,ytop,ybottom,ybottom,ytop],'w')
#plot 3 tick marks at left edge, center, and right edge
m.plot([x1,x1],[ytick,ybottom],color='k')
m.plot([xc,xc],[ytick,ybottom],color='k')
m.plot([x4,x4],[ytick,ybottom],color='k')
#label 3 tick marks
text(x1,ytext,'%d' % (0),\
horizontalalignment='center',\
verticalalignment='top',\
fontsize=9)
text(xc,ytext,'%d' % (round((length/2)/1000)),\
horizontalalignment='center',\
verticalalignment='top',\
fontsize=9)
text(x4,ytext,'%d' % (round((length)/1000)),\
horizontalalignment='center',\
verticalalignment='top',\
fontsize=9)
#put units on top
text(xc,ytop+yoffset/2,'km',\
horizontalalignment='center',\
verticalalignment='bottom',\
fontsize=9)
# setup of basemap ('lcc' = lambert conformal conic).
# use major and minor sphere radii from WGS84 ellipsoid.
m = Basemap2
(llcrnrlon=-145.5,llcrnrlat=1.,urcrnrlon=-2.566,urcrnrlat=46.352,\
rsphere=(6378137.00,6356752.3142),\
resolution='l',area_thresh=1000.,projection='lcc',\
lat_1=50.,lon_0=-107.)
# draw coastlines and political boundaries.
m.drawcoastlines()
m.fillcontinents()
# draw parallels and meridians.
# label on left, right and bottom of map.
m.drawparallels(arange(0.,80,20.),labels=[1,1,0,1])
m.drawmeridians(arange(10.,360.,30.),labels=[1,1,0,1])
# draw a line from x1,y to x2,y and label it with distance in km.
length = 3000 #kilometers
x1,y1 = 0.25*m.xmax, 0.25*m.ymax
lon1,lat1 = m(x1,y1,inverse=True)
m.drawscale(lon1,lat1,length)
title('a fancy map scale')
show()
------------------------------------------------------
Michael Hearne
mh...@us...
(303) 273-8620
USGS National Earthquake Information Center
1711 Illinois St. Golden CO 80401
Senior Software Engineer
Synergetics, Inc.
------------------------------------------------------
|
|
From: Jeff W. <js...@fa...> - 2008-03-03 21:22:34
|
Adam Mercer wrote: > On Sun, Dec 23, 2007 at 2:40 PM, Jeff Whitaker <js...@fa...> wrote: > > >> > Will basemap work with the newly released GEOS-3.0.0, or does it only >> > work with 2.2.3 for now? >> >> Adam: It only works with 2.2.3. I have not been able to make it work >> with 3.0.0, so I don't know if it ever will. >> > > What are the problems you've been having with geos 3.0.0? > > Cheers > > Adam > Adam: It chokes on valid polygons that 2.2.3 accepted. -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: Jeff W. <js...@fa...> - 2008-03-03 21:21:28
|
Michael Hearne wrote:
> Does the capability exist in basemap to create a scale bar on the map?
> If not, is this planned for the future?
>
> For reference, see the -L option in GMT's psbasemap, pscoast, etc.
>
> Thanks,
>
Michael: Is this the sort of thing you're looking for?
#from mpl_toolkits.basemap import Basemap, pyproj # for svn
from matplotlib.toolkits.basemap import Basemap, pyproj
from pylab import *
# add drawscale method to Basemap class.
class Basemap2(Basemap):
def drawscale(self,x1,x2,y,yoffset=None):
"""draw a simple map scale from x1,y to x2,y in map projection
coordinates, label it with actual distance in km"""
length = sqrt((x2-x1)**2)
if yoffset is None: yoffset = 0.1*length
lon1,lat1 = self(x1,y,inverse=True)
lon2,lat2 = self(x2,y,inverse=True)
gc = pyproj.Geod(a=self.rmajor,b=self.rminor)
az12,az21,dist = gc.inv(lon1,lat1,lon2,lat2)
m.plot([x1,x2],[y,y],color='k')
m.plot([x1,x1],[y-yoffset,y+yoffset],color='k')
m.plot([x2,x2],[y-yoffset,y+yoffset],color='k')
text(x1+0.5*length,y-yoffset,'%d km' % (dist/1000.,),\
verticalalignment='top',\
horizontalalignment='center',fontsize=9)
# setup of basemap ('lcc' = lambert conformal conic).
# use major and minor sphere radii from WGS84 ellipsoid.
m =\ Basemap2(llcrnrlon=-145.5,llcrnrlat=1.,urcrnrlon=-2.566,urcrnrlat=46.352,\
rsphere=(6378137.00,6356752.3142),\
resolution='l',area_thresh=1000.,projection='lcc',\
lat_1=50.,lon_0=-107.)
# draw coastlines and political boundaries.
m.drawcoastlines()
m.fillcontinents()
# draw parallels and meridians.
# label on left, right and bottom of map.
m.drawparallels(arange(0.,80,20.),labels=[1,1,0,1])
m.drawmeridians(arange(10.,360.,30.),labels=[1,1,0,1])
# draw a line from x1,y to x2,y and label it with distance in km.
length = 1.e6
x1,x2,y = 0.5*m.xmax, 0.5*m.xmax+length, 0.35*m.ymax
m.drawscale(x1,x2,y)
title('a simple map scale')
show()
If so, I could add something like this in the next release.
-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: Adam M. <ram...@gm...> - 2008-03-03 21:19:54
|
On Sun, Dec 23, 2007 at 2:40 PM, Jeff Whitaker <js...@fa...> wrote: > > Will basemap work with the newly released GEOS-3.0.0, or does it only > > work with 2.2.3 for now? > > Adam: It only works with 2.2.3. I have not been able to make it work > with 3.0.0, so I don't know if it ever will. What are the problems you've been having with geos 3.0.0? Cheers Adam |
|
From: Vincent Favre-N. <vi...@us...> - 2008-03-03 19:32:38
|
Hi, See the bug here (and the answers) : http://www.mail-archive.com/mat...@li.../msg02348.html From the last answer it appears this was fixed after 0.91.2 It affects saving png's (other formats work) from the GUI, but savefig() should work. Vincent -- Vincent Favre-Nicolin Université Joseph Fourier http://v.favrenicolin.free.fr ObjCryst & Fox : http://objcryst.sourceforge.net |
|
From: Michael H. <mh...@us...> - 2008-03-03 17:43:27
|
Does the capability exist in basemap to create a scale bar on the map? If not, is this planned for the future? For reference, see the -L option in GMT's psbasemap, pscoast, etc. Thanks, ------------------------------------------------------ Michael Hearne mh...@us... (303) 273-8620 USGS National Earthquake Information Center 1711 Illinois St. Golden CO 80401 Senior Software Engineer Synergetics, Inc. ------------------------------------------------------ |
|
From: John H. <jd...@gm...> - 2008-03-03 17:41:31
|
On Mon, Mar 3, 2008 at 8:51 AM, Troels Kofoed Jacobsen
<tkj...@gm...> wrote:
> Hi everybody
>
> I have modified the load function (in matplotlib.mlab) to be able to load
> strings e.g for use as xticks. Anyone willing to test and comment, 'cause
> when i'm done i'll send it as a patch.
>
> The usage is as follows:
>
> from reload import load
> s,A,B=reload('data.dat',usecols=(1,2),unpack=True,string=0)
You probably want to be using matplotlib.mlab.csv2rec, which already
supports heterogeneous types (including strings and datetime). load
is meant to handle only float output, and will probably become
deprecated in favor of numpy's loadtxt. If you want to enhance load
you should concentrate your efforts there -- numpy.io.loadtxt is just
a copy plus enhancement of matplotlib.mlab.load.
JDH
|
|
From: Christopher B. <Chr...@no...> - 2008-03-03 17:28:19
|
sa6113 wrote: > Would you please help me ? > I want to load data to Image (QImage) from String or binary String without > using PIL module . you can load data straight into a numpy array with numpy.fromstring() -- if it's in an easy format (RGB, RGBA), then you should be able to go from there. What do you want to do with the image data? -CHB -- 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: Jeff P. <jef...@se...> - 2008-03-03 16:12:30
|
Hi Mike, thanks for the tip. I will try it. I'm using 0.91.2. Thanks, Jeff -----Original Message----- From: Michael Droettboom [mailto:md...@st...] Sent: Monday, March 03, 2008 5:06 AM To: Jef...@se... Cc: mat...@li... Subject: Re: [Matplotlib-users] error in savefig with wxAgg backend What version of matplotlib are you using? I have a vague recollection that this was fixed at one point. In any case, you should be able to get around this by casting your filename to a string as such: self.figure.savefig(str(image_file)) Hope that works for you, Mike Jeff Peery wrote: > Hello, > > I'm trying to use savefig in my wx app and I'm using wxAgg backend. I'm > getting this error: > > > > FILE .maplotlib\backends\backend_bases.py, line 397 in print_png > > Self.get_renderer()._renderer.write_png(filename, self.figure.dpi.dpi.get()) > > TypeError: cannot return std::string from Unicode object > > > > I'm simply calling this: > > > > self.figure.savefig(image_file, > > facecolor='w', > > edgecolor='w') > > > > How do I fix this problem? Thanks. > > > > Jeff > > > > > > > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > > > ------------------------------------------------------------------------ > > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA |
|
From: Troels K. J. <tkj...@gm...> - 2008-03-03 14:51:13
|
Hi everybody
I have modified the load function (in matplotlib.mlab) to be able to load
strings e.g for use as xticks. Anyone willing to test and comment, 'cause
when i'm done i'll send it as a patch.
The usage is as follows:
from reload import load
s,A,B=reload('data.dat',usecols=(1,2),unpack=True,string=0)
here the data file is like:
# Molecule Energy1 Energy2
Fe -831 -832
Pt -923 -932
It can also be used without unpack, but only one array of strings can be
extracted.
--
Med Venlig Hilsen / Best regards
Troels Kofoed Jacobsen
|
|
From: Michael D. <md...@st...> - 2008-03-03 14:44:28
|
David Moore wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Michael Droettboom wrote: >> Jesper Larsen wrote: >>> Hi Matplotlib users, >>> >>> I have an application which produces PNG files using the AGG backend. >>> When I profile the application I can see that much of the cpu time is >>> spent in the method write_png called by print_figure in backend_agg.py. >> I have seen this myself. Keep in mind that timing includes a lot of >> disk I/O, so if your images are particularly large, or you're saving to >> a network or external disk, or if another process steps in at that >> moment and wants to read/write to the disk, that could be the >> bottleneck, more so than just the CPU time spent doing the PNG >> compression. On any reasonably modern PC, I suspect that's the case. >> >>> Does anyone know which backend is the best for producing fast good >>> quality PNG files (with fast being as important as good quality)? >> They should all be approximately the same wrt actually writing out the >> file -- they're all using libpng either directly or indirectly. It also >> means there's not much that matplotlib can do to improve its >> performance, short of submitting patches to libpng -- but I suspect >> there isn't a lot of long-hanging fruit left to improve in such a >> widely-used library. >> >>> In another thread I read that antialiasing could be disabled for better >>> performance. I tried doing that in each call to contourf and it resulted >>> in a performance improvement. Does anyone have other performance tips >>> with regard to PNG files? >> Saving to a Python file-like object (if you're doing that) is slower >> than saving directly to a file path. > > This seems to contradict your previous assertion that the bottleneck is likely > to be disk I/O - if you're saving to a Python file-like object, there's no disk > I/O. Why is this slower? All things being equal -- if the Python file-like object is saving to an on-disk file -- the Python file-like object will be slower. Sometimes people do this if the want another layer of abstraction (e.g. saving to a gzip file) or to be more general. What I mean is that: savefig(open(filename)) is slower than savefig(filename) because the latter makes a Python function call to save each block of data. Mike -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA |
|
From: Jesper L. <jl...@dm...> - 2008-03-03 14:28:49
|
On Mon, 2008-03-03 at 08:16 -0500, Michael Droettboom wrote: > > I have an application which produces PNG files using the AGG backend. > > When I profile the application I can see that much of the cpu time is > > spent in the method write_png called by print_figure in backend_agg.py. > > I have seen this myself. Keep in mind that timing includes a lot of > disk I/O, so if your images are particularly large, or you're saving to > a network or external disk, or if another process steps in at that > moment and wants to read/write to the disk, that could be the > bottleneck, more so than just the CPU time spent doing the PNG > compression. On any reasonably modern PC, I suspect that's the case. > > > Does anyone know which backend is the best for producing fast good > > quality PNG files (with fast being as important as good quality)? > > They should all be approximately the same wrt actually writing out the > file -- they're all using libpng either directly or indirectly. It also > means there's not much that matplotlib can do to improve its > performance, short of submitting patches to libpng -- but I suspect > there isn't a lot of long-hanging fruit left to improve in such a > widely-used library. My application is web based. I am therefore considering serving the png files directly from memory in a future release as outlined here: http://www.scipy.org/Cookbook/Matplotlib/Matplotlib_and_Zope Although I am still considering what impacts that will have on my caching of the plots. I am currently saving the png files and reusing them if the same plot is requested again - but I am considering pickling individual elements of the plots instead since there are a lot of plots in which the only differences is some text (I am already caching parts of the plot in memory). But I don't know the performance of such a solution yet. I will give you a heads up when I know (which won't be in the immediate future since I have other things that are higher up on my to do list). > > In another thread I read that antialiasing could be disabled for better > > performance. I tried doing that in each call to contourf and it resulted > > in a performance improvement. Does anyone have other performance tips > > with regard to PNG files? > > Saving to a Python file-like object (if you're doing that) is slower > than saving directly to a file path. > > See the recent thread on "Matplotlib performance" for a discussion of > decimation of data (if your data set is really large). I am writing directly to a file path and I have already decimated my data sets - so that won't help me. Cheers, Jesper |
|
From: David M. <da...@sj...> - 2008-03-03 13:35:11
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Michael Droettboom wrote: > Jesper Larsen wrote: >> Hi Matplotlib users, >> >> I have an application which produces PNG files using the AGG backend. >> When I profile the application I can see that much of the cpu time is >> spent in the method write_png called by print_figure in backend_agg.py. > > I have seen this myself. Keep in mind that timing includes a lot of > disk I/O, so if your images are particularly large, or you're saving to > a network or external disk, or if another process steps in at that > moment and wants to read/write to the disk, that could be the > bottleneck, more so than just the CPU time spent doing the PNG > compression. On any reasonably modern PC, I suspect that's the case. > >> Does anyone know which backend is the best for producing fast good >> quality PNG files (with fast being as important as good quality)? > > They should all be approximately the same wrt actually writing out the > file -- they're all using libpng either directly or indirectly. It also > means there's not much that matplotlib can do to improve its > performance, short of submitting patches to libpng -- but I suspect > there isn't a lot of long-hanging fruit left to improve in such a > widely-used library. > >> In another thread I read that antialiasing could be disabled for better >> performance. I tried doing that in each call to contourf and it resulted >> in a performance improvement. Does anyone have other performance tips >> with regard to PNG files? > > Saving to a Python file-like object (if you're doing that) is slower > than saving directly to a file path. This seems to contradict your previous assertion that the bottleneck is likely to be disk I/O - if you're saving to a Python file-like object, there's no disk I/O. Why is this slower? thanks, Dave [snip] -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkfL/nwACgkQOP+t1LlaoiHOLACgs9OjjjP/g1MZW9QVW7N4i1CU bJ0An2tgdi+3bXL/gX2e+ZRAEswPgapw =nkGp -----END PGP SIGNATURE----- |
|
From: Michael D. <md...@st...> - 2008-03-03 13:16:40
|
Jesper Larsen wrote: > Hi Matplotlib users, > > I have an application which produces PNG files using the AGG backend. > When I profile the application I can see that much of the cpu time is > spent in the method write_png called by print_figure in backend_agg.py. I have seen this myself. Keep in mind that timing includes a lot of disk I/O, so if your images are particularly large, or you're saving to a network or external disk, or if another process steps in at that moment and wants to read/write to the disk, that could be the bottleneck, more so than just the CPU time spent doing the PNG compression. On any reasonably modern PC, I suspect that's the case. > Does anyone know which backend is the best for producing fast good > quality PNG files (with fast being as important as good quality)? They should all be approximately the same wrt actually writing out the file -- they're all using libpng either directly or indirectly. It also means there's not much that matplotlib can do to improve its performance, short of submitting patches to libpng -- but I suspect there isn't a lot of long-hanging fruit left to improve in such a widely-used library. > In another thread I read that antialiasing could be disabled for better > performance. I tried doing that in each call to contourf and it resulted > in a performance improvement. Does anyone have other performance tips > with regard to PNG files? Saving to a Python file-like object (if you're doing that) is slower than saving directly to a file path. See the recent thread on "Matplotlib performance" for a discussion of decimation of data (if your data set is really large). Cheers, Mike -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA |
|
From: Michaël D. <mic...@la...> - 2008-03-03 13:14:17
|
Thanks Pierre, I will try this package and come back here to give a feedback Michael Pierre GM a écrit : > Michael, > Give scikits.timeseries a try. It's a package designed to handle time series, > with or without missing data or dates, for which matplotlib functions are > also available. > http://scipy.org/scipy/scikits/wiki/TimeSeries > The problem you're refering to (missing dates) is trivial with this package. > Let me know if you have any problem with it. Please note that plotting with > hourly frequency is still experimental (and we need some feedback). > HIH > P. > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > > |
|
From: Michael D. <md...@st...> - 2008-03-03 13:06:10
|
What version of matplotlib are you using? I have a vague recollection that this was fixed at one point. In any case, you should be able to get around this by casting your filename to a string as such: self.figure.savefig(str(image_file)) Hope that works for you, Mike Jeff Peery wrote: > Hello, > > I’m trying to use savefig in my wx app and I’m using wxAgg backend. I’m > getting this error: > > > > FILE …maplotlib\backends\backend_bases.py, line 397 in print_png > > Self.get_renderer()._renderer.write_png(filename, self.figure.dpi.dpi.get()) > > TypeError: cannot return std::string from Unicode object > > > > I’m simply calling this: > > > > self.figure.savefig(image_file, > > facecolor='w', > > edgecolor='w') > > > > How do I fix this problem? Thanks. > > > > Jeff > > > > > > > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > > > ------------------------------------------------------------------------ > > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA |
|
From: Jesper L. <jl...@dm...> - 2008-03-03 10:12:32
|
Hi Matplotlib users, I have an application which produces PNG files using the AGG backend. When I profile the application I can see that much of the cpu time is spent in the method write_png called by print_figure in backend_agg.py. Does anyone know which backend is the best for producing fast good quality PNG files (with fast being as important as good quality)? In another thread I read that antialiasing could be disabled for better performance. I tried doing that in each call to contourf and it resulted in a performance improvement. Does anyone have other performance tips with regard to PNG files? Cheers, Jesper |