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
(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)





Showing results of 450

1 2 3 .. 18 > >> (Page 1 of 18)
From: Christopher B. <Chr...@no...> - 2008年03月31日 23:16:08
Hi all,
as far as I can tell, matplotlib.py2exe_datafiles is broken with the 
latest release. Is it getting fixed?
Also, there is a LOT of stuff in there -- is there a way to strip out 
the stuff you may not need for a particular application? I'm using MPl 
embedded in a wxPython app, and I don't need the icons, etc, nor do a 
need a bunch of fonts. I suppose it's just disk space, though.
One more question:
In mpl-data, there are a bunch of images and fonts. There are also 
subdirectories "images", and "fonts", with a bunch more? My the 
different places for these?
-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: Christopher B. <Chr...@no...> - 2008年03月31日 17:51:33
Gregor Thalhammer wrote:
> for repainting a matplotlib figure, every time a repaint is done also 
> the bitmap is rerendered:
> 
> backend_wx.py/_onPaint():
> ...
> # Render to the bitmap
> self.draw(repaint=False)
> ...
You're quite right -- the paint handler should only blit to the 
PaintDC, which, in this case, is:
self.gui_repaint(drawDC=wx.PaintDC(self))
However, if I comment out that call to self.draw, I get a blank screen 
in a wxmpl app of mine. If I re-size the Window, then it gets draw 
('cause the OnSize handler is re-drawing).
Also, in the same app, even when I call Figure.draw(), I'm notgetting it 
updated.
So it looks like there is code counting on this extra draw call.
I'll poke into it a bit more, it may be somethign we can fix in wxmpl, 
if there aren't issues elsewhere.
-Chris
> This also affects the behaviour of the wxagg backend.
yes, it looks like _onPaint is inherited from FigureCanvasWx, so it's 
the same issue.
 Rerendering and
> therefore also repainting gets quite slow if, e.g., images are included 
> in the figure. I can see this by simply dragging another window across 
> the matplotlibfigure. Commenting out the rerendering I get a much 
> smoother behaviour. I could not observe problems except that sometimes 
> some parts of the figure are not properly repainted if the matplotlib 
> figure is in the background (I only tested the wxagg backend). Therefore 
> it seems that this rerendering every time a repaint is performed is not 
> really necessary and should be avoided.
> 
> I tested this on matplotlib 0.91.2 on WinXP, Python 2.5, wx 2.8.7. I 
> checked that in the current svn version the _onPaint() function is 
> unchanged.
> 
> Gregor
> 
> -------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
> _______________________________________________
> Matplotlib-devel mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
-- 
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: Nick S. <mat...@ni...> - 2008年03月31日 16:08:20
Hi,
I am new to this list, so forgive me if this has been asked before. I am
trying to do a radial plot and the following code does not seem to work:
# ------< START CODE >-------
import pylab
import matplotlib
fig = pylab.figure(figsize=(8,8))
ax = fig.add_axes([0.1, 0.1, 0.8, 0.8], polar=True)
pylab.hold(True)
ax.plot([4.189, 4.188],[41.347, 41.058], color = 'green', lw=1)
#ax.plot([4.199, 4.188],[41.347, 41.058], color = 'green', lw=1)
ax.set_rmax(80) # scale plot
pylab.show()
# ------< END CODE >-------
When you run this, the entire background of the plot turns green. If you
comment out the first "ax.plot" and uncomment the line below it, it works as
expected. Any ideas as to what is going on? Is there some kind of limitation
to the smallest line allowed? Thanks for any help!
---Nick
From: Jeff W. <js...@fa...> - 2008年03月31日 14:56:17
KURT PETERS wrote:
> Thanks,
> I'll give that a try. I had seen the other example, but had a very 
> difficult time figuring out what this line does:
> x, y = zip(*m.cities)
Kurt:
See the docs for the zip built-in python function at 
http://docs.python.org/lib/built-in-funcs.html.
x,y = zip(*<list of tuples> is just the reverse of zip(x,y)
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/103702
>
> Frankly, I have google'ed possibilities, but "zip" is so 
> ubiquitous, that figuring out what it really does in THIS case is 
> difficult. Do you have a good explanation of why that's necessary? (I 
> saw nothing in the shapefile docs that talks to zipping files.
> I'm not sure why 'enumerate' doesn't work?
> I will give the annotate a try with the code you provided and see if 
> that works. Also, is there a particular reason why you chose '10' 
> for your zorder? Use of that parameter is not especially clear in the 
> documentaion - perhaps having a table with what other thing's zorders 
> are would help.
There's nothing magic about 10. It just has to be greater than 1 so the 
dots come out on top of the continent fill. If you leave out the call 
to fillcontinents, you don't need the zorder at all.
>
> As for suggestions about the shapefile doc/usability. I think it's 
> hard to handle such a multidimensional data format in a workable 
> sense. I'm getting the hang of it. It's hard to have visualization 
> of what the shapefile looks like. Perhaps some kind of auto schematic 
> (think Visio or graphviz) function would be neat to show how things 
> are mapped in the shapefile and something that tells you line, poly, 
> point, etc., in the blocks and how they map to a built-in pylib class?
The thing is, shapefiles are not really a format I use a lot. I tend to 
work on things that I actually use the most.
> If you had more of a wiki format to the documentation, I know I 
> would have modified the docs to make things clearer as I've been 
> muddling through. Perhaps making a tutorial. It's especially true 
> since I've been teaching myself about shapefiles as well.
That's a good idea. Making a tutorial has always been on my to-do list, 
but I never seem to get the time. It would be a great if someone would 
step up and contribute one.
-Jeff
>
> Kurt
> ----Original Message Follows----
> From: Jeff Whitaker <js...@fa...>
> To: KURT PETERS <pet...@ms...>
> CC: mat...@li...
> Subject: Re: [Matplotlib-users] Basemaps - shapefile import/display 
> for points
> Date: 2008年3月31日 06:27:50 -0600
>
> KURT PETERS wrote:
>> OK Jeff, Thanks for your help on the previous question - I had been 
>> playing with different projections and resolutions, so that's why the 
>> comments didn't match the actual settings in the procedure calls. 
>> Now for a "real" problem:
>>
>> I'm trying to plot the cities from this web site: 
>> http://nationalatlas.gov/metadata/citiesx020.faq.html
>> using that shapefile, which uses points, not polygons (it took a long 
>> time to figure out that difference from the example of fillstates.py).
>> http://nationalatlas.gov/atlasftp.html?openChapters=chpref#chpref
>>
>> While I think I'm loading everything and displaying everything 
>> correctly, the values are not plotting right, nor do they seem 
>> realistic.
>>
>> For instance the point values look like this (which really can't be 
>> right):
>>
>> Shape num Fairbanks, coords=(42082.855349492747, 5336578.2660309337)
>> Shape num Anchorage, coords=(-442294.67146861833, 5031412.4918638617)
>>
>> print shp_info - the second value shows to use points not polys:
>> (35432, 1, [-174.20294189453125, 17.711706161499023, 0.0, 0.0], 
>> [178.87460327148437, 71.290138244628906, 0.0, 0.0])
>> Dictionaries:
>> ['STATE_FIPS', 'NAME', 'POP_2000', 'FEATURE', 'COUNTY', 'STATE', 
>> 'FIPS', 'CITIESX020', 'FIPS55', 'DISPLAY', 'POP_RANGE']
>> STATE_FIPS = 02, NAME = Anchorage, POP_2000=260283, FEATURE = County 
>> Seat, COUNTY=Anchorage Borough, STATE=AK, FIPS=02020, CITIESX020 = 
>> 194, FIPS55=03000, DISPLAY=0, POP_RANGE=250,000 - 499,999
>>
>>
>>
>> Here's the code:
>> ===============
>> import pylab as p
>> import numpy
>> from matplotlib.toolkits.basemap import Basemap as Basemap
>> from matplotlib.colors import rgb2hex
>> from matplotlib.patches import Polygon
>>
>> # Lambert Conformal map of lower 48 states.
>> # create new figure
>> fig=p.figure()
>> m1 = Basemap(llcrnrlon=-119,llcrnrlat=22,urcrnrlon=-64,urcrnrlat=49,\
>> projection='lcc',lat_1=33,lat_2=45,lon_0=-95,resolution='c')
>> shp_info = 
>> m1.readshapefile(r'C:\Python25\Lib\basemap-0.9.9.1\examples\citiesx020','states',drawbounds=True) 
>>
>>
>> ax=p.gca()
>>
>> #define SHPT_POINT 1 Points
>> #define SHPT_ARC 3 Arcs (Polylines, possible in parts)
>> #define SHPT_POLYGON 5 Polygons (possible in parts)
>> #define SHPT_MULTIPOINT 8 MultiPoint (related points)
>> print shp_info
>> print m1.states_info[0].keys()
>> seqnum={}
>> criteriatodisplay=[]
>> ii=0
>> for shapedict in m1.states_info:
>> if int(shapedict['POP_2000'])>100000:
>> #'STATE_FIPS', 'NAME', 'POP_2000', 'FEATURE', 'COUNTY', 'STATE', 
>> 'FIPS', 'CITIESX020', 'FIPS55', 'DISPLAY', 'POP_RANGE']
>> print 'STATE_FIPS = %s, NAME = %s, POP_2000=%s, FEATURE = %s, 
>> COUNTY=%s, STATE=%s, FIPS=%s, CITIESX020 = %s, FIPS55=%s, DISPLAY=%s, 
>> POP_RANGE=%s' %\
>> (str(shapedict['STATE_FIPS']), str(shapedict['NAME']), 
>> str(shapedict['POP_2000']), str(shapedict['FEATURE']), 
>> str(shapedict['COUNTY']), str(shapedict['STATE']), 
>> str(shapedict['FIPS']), str(shapedict['CITIESX020']), 
>> str(shapedict['FIPS55']), str(shapedict['DISPLAY']), 
>> str(shapedict['POP_RANGE']))
>> seqnum[shapedict['CITIESX020']]=shapedict['NAME']
>> criteriatodisplay.append(shapedict['CITIESX020'])
>> ii+=1
>>
>> print ii
>>
>> for nshape,seg in enumerate(m1.states):
>> if nshape in criteriatodisplay:
>> print 'Shape num %s, coords=%s' % (seqnum[nshape], seg)
>> h= [seg[0]*0.000278,seg[1]*0.000278]
>>
>> ax.annotate(seqnum[nshape],h)
>> m1.drawcoastlines()
>> m1.fillcontinents()
>> m1.drawcountries()
>> m1.drawstates()
>> m1.drawparallels(numpy.arange(25,65,4),labels=[1,0,0,0])
>> m1.drawmeridians(numpy.arange(-120,-40,4),labels=[0,0,0,1])
>> p.title('Test Cities')
>> p.show()
>> =============
>> Regards,
>> Kurt
>>
>>
>
> Kurt: I had no trouble plotting them with this script:
>
> m = Basemap(llcrnrlon=-119,llcrnrlat=22,urcrnrlon=-64,urcrnrlat=49,\
> projection='lcc',lat_1=33,lat_2=45,lon_0=-95,resolution='c')
> shp_info = m.readshapefile('citiesx020','cities')
> x, y = zip(*m.cities)
> m.drawcoastlines()
> m.drawcountries()
> m.fillcontinents()
> m.scatter(x,y,2,'b',marker='o',faceted=False,zorder=10)
> p.show()
>
> This is adapted from the plotcities.py example, which was designed for 
> point files (fillstates.py was designed for polygon files). In this 
> case, m.cities is just a list of x,y coordinates. I don't know why 
> ax.annotate wasn't working for you.
>
> I know the shapefile stuff is non-intuitive and could use a lot of 
> work. Perhaps when you can offer some suggestions for the docs, or 
> for re-designing the interface.
>
> -Jeff
>
>
> -- 
> Jeffrey S. Whitaker Phone : (303)497-6313
> NOAA/OAR/CDC R/PSD1 FAX : (303)497-6449
> 325 Broadway Boulder, CO, USA 80305-3328
>
>
-- 
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月31日 12:28:04
KURT PETERS wrote:
> OK Jeff, Thanks for your help on the previous question - I had been playing 
> with different projections and resolutions, so that's why the comments 
> didn't match the actual settings in the procedure calls. Now for a "real" 
> problem:
>
> I'm trying to plot the cities from this web site: 
> http://nationalatlas.gov/metadata/citiesx020.faq.html
> using that shapefile, which uses points, not polygons (it took a long time 
> to figure out that difference from the example of fillstates.py).
> http://nationalatlas.gov/atlasftp.html?openChapters=chpref#chpref
>
> While I think I'm loading everything and displaying everything correctly, 
> the values are not plotting right, nor do they seem realistic.
>
> For instance the point values look like this (which really can't be right):
>
> Shape num Fairbanks, coords=(42082.855349492747, 5336578.2660309337)
> Shape num Anchorage, coords=(-442294.67146861833, 5031412.4918638617)
>
> print shp_info - the second value shows to use points not polys:
> (35432, 1, [-174.20294189453125, 17.711706161499023, 0.0, 0.0], 
> [178.87460327148437, 71.290138244628906, 0.0, 0.0])
> Dictionaries:
> ['STATE_FIPS', 'NAME', 'POP_2000', 'FEATURE', 'COUNTY', 'STATE', 'FIPS', 
> 'CITIESX020', 'FIPS55', 'DISPLAY', 'POP_RANGE']
> STATE_FIPS = 02, NAME = Anchorage, POP_2000=260283, FEATURE = County Seat, 
> COUNTY=Anchorage Borough, STATE=AK, FIPS=02020, CITIESX020 = 194, 
> FIPS55=03000, DISPLAY=0, POP_RANGE=250,000 - 499,999
>
>
>
> Here's the code:
> ===============
> import pylab as p
> import numpy
> from matplotlib.toolkits.basemap import Basemap as Basemap
> from matplotlib.colors import rgb2hex
> from matplotlib.patches import Polygon
>
> # Lambert Conformal map of lower 48 states.
> # create new figure
> fig=p.figure()
> m1 = Basemap(llcrnrlon=-119,llcrnrlat=22,urcrnrlon=-64,urcrnrlat=49,\
> projection='lcc',lat_1=33,lat_2=45,lon_0=-95,resolution='c')
> shp_info = 
> m1.readshapefile(r'C:\Python25\Lib\basemap-0.9.9.1\examples\citiesx020','states',drawbounds=True)
>
> ax=p.gca()
>
> #define SHPT_POINT 1 Points
> #define SHPT_ARC 3 Arcs (Polylines, possible in parts)
> #define SHPT_POLYGON 5 Polygons (possible in parts)
> #define SHPT_MULTIPOINT 8 MultiPoint (related points)
> print shp_info
> print m1.states_info[0].keys()
> seqnum={}
> criteriatodisplay=[]
> ii=0
> for shapedict in m1.states_info:
> if int(shapedict['POP_2000'])>100000:
> #'STATE_FIPS', 'NAME', 'POP_2000', 'FEATURE', 'COUNTY', 'STATE', 'FIPS', 
> 'CITIESX020', 'FIPS55', 'DISPLAY', 'POP_RANGE']
> print 'STATE_FIPS = %s, NAME = %s, POP_2000=%s, FEATURE = %s, 
> COUNTY=%s, STATE=%s, FIPS=%s, CITIESX020 = %s, FIPS55=%s, DISPLAY=%s, 
> POP_RANGE=%s' %\
> (str(shapedict['STATE_FIPS']), str(shapedict['NAME']), 
> str(shapedict['POP_2000']), str(shapedict['FEATURE']), 
> str(shapedict['COUNTY']), str(shapedict['STATE']), str(shapedict['FIPS']), 
> str(shapedict['CITIESX020']), str(shapedict['FIPS55']), 
> str(shapedict['DISPLAY']), str(shapedict['POP_RANGE']))
> seqnum[shapedict['CITIESX020']]=shapedict['NAME']
> criteriatodisplay.append(shapedict['CITIESX020'])
> ii+=1
>
> print ii
>
> for nshape,seg in enumerate(m1.states):
> if nshape in criteriatodisplay:
> print 'Shape num %s, coords=%s' % (seqnum[nshape], seg)
> h= [seg[0]*0.000278,seg[1]*0.000278]
>
> ax.annotate(seqnum[nshape],h)
> m1.drawcoastlines()
> m1.fillcontinents()
> m1.drawcountries()
> m1.drawstates()
> m1.drawparallels(numpy.arange(25,65,4),labels=[1,0,0,0])
> m1.drawmeridians(numpy.arange(-120,-40,4),labels=[0,0,0,1])
> p.title('Test Cities')
> p.show()
> =============
> Regards,
> Kurt
>
> 
Kurt: I had no trouble plotting them with this script:
m = Basemap(llcrnrlon=-119,llcrnrlat=22,urcrnrlon=-64,urcrnrlat=49,\
 projection='lcc',lat_1=33,lat_2=45,lon_0=-95,resolution='c')
shp_info = m.readshapefile('citiesx020','cities')
x, y = zip(*m.cities)
m.drawcoastlines()
m.drawcountries()
m.fillcontinents()
m.scatter(x,y,2,'b',marker='o',faceted=False,zorder=10)
p.show()
This is adapted from the plotcities.py example, which was designed for 
point files (fillstates.py was designed for polygon files). In this 
case, m.cities is just a list of x,y coordinates. I don't know why 
ax.annotate wasn't working for you.
I know the shapefile stuff is non-intuitive and could use a lot of 
work. Perhaps when you can offer some suggestions for the docs, or for 
re-designing the interface. 
-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: greg w. <gr...@th...> - 2008年03月30日 01:31:11
Anyone find an answer to this one? I'm running into this issue with
0.90.1and I found this in the archives. I tried the suggested code
and it doesn't
seem to work for me. Right now my workaround is
 min_x = min([min(line.get_xdata()) for line in self.axes.lines])
 max_x = max([max(line.get_xdata()) for line in
self.axes.lines])
 self.axes.set_xlim(min_x,max_x)
Any suggestions?
Thanks,
Greg
On Tue, Nov 14, 2006 at 8:13 PM, Andrea Gavana <and...@gm...>
wrote:
> Hi John,
>
> sorry to come back so late with this subject. Well, I have tried
> your suggestion:
>
> > When you add lines to the plot, the dataLim are updated, but when you
> > remove data with del ax.lines[-1] etc, the dataLim are not updated.
> > If all you have in the Axes are line instances, you can update the
> > dataLim with the remaining lines, but first you must tell it to ignore
> > it's current limits. You do this with the ignore flag
> >
> > # after removing a line, do
> > ignore = True
> > for line in ax.lines:
> > x = line.get_xdata()
> > y = line.get_ydata()
> > ax.dataLim.update_numerix(x, y, ignore)
> > ignore = False
> >
>
> No way, it doesn't update the axes. Uhm, in my plot I have only lines
> and one legend, nothing more. Even if I try a simple case with 2 lines
> and I remove one of them, the axes still stay with their previous
> limits. I must be missing something.
>
> > After you have tested this, would you mind updating the wiki with this
> > information?
>
> No problem, as soon as I am able to update the axes, I will add that
> info to the wiki.
>
> Thank you.
>
> Andrea.
>
> "Imagination Is The Only Weapon In The War Against Reality."
> http://xoomer.virgilio.it/infinity77/
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share
> your
> opinions on IT & business topics through brief surveys - and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: Adrian Price-W. <pri...@ma...> - 2008年03月29日 19:29:30
I'm fairly new to UNIX shell and I'm having a bit of trouble building 
matplotlib on my computer:
running build
running build_py
copying lib/matplotlib/mpl-data/matplotlibrc -> build/lib.macosx-10.3- 
fat-2.5/matplotlib/mpl-data
copying lib/matplotlib/mpl-data/matplotlib.conf -> build/ 
lib.macosx-10.3-fat-2.5/matplotlib/mpl-data
running build_ext
building 'matplotlib.ft2font' extension
C compiler: gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/ 
MacOSX10.4u.sdk -fno-strict-aliasing -Wno-long-double -no-cpp-precomp - 
mno-fused-madd -fno-common -dynamic -DNDEBUG -g -O3
compile options: '-I/usr/X11/include/freetype2 -I/usr/X11/include -I/ 
sw/lib/freetype219/include -I/usr/local/include -I/usr/include -I/sw/ 
include -I/usr/X11R6/include -I. -I/Library/Frameworks/ 
Python.framework/Versions/2.5/include/python2.5 -c'
g++ -arch i386 -arch ppc -isysroot /Developer/SDKs/MacOSX10.4u.sdk -g - 
bundle -undefined dynamic_lookup build/temp.macosx-10.3-fat-2.5/src/ 
ft2font.o build/temp.macosx-10.3-fat-2.5/src/mplutils.o build/ 
temp.macosx-10.3-fat-2.5/CXX/cxx_extensions.o build/temp.macosx-10.3- 
fat-2.5/CXX/cxxsupport.o build/temp.macosx-10.3-fat-2.5/CXX/ 
IndirectPythonInterface.o build/temp.macosx-10.3-fat-2.5/CXX/ 
cxxextensions.o -L/usr/X11/lib -L/sw/lib/freetype219/lib -L/usr/local/ 
lib -L/usr/lib -L/sw/lib -L/usr/X11R6/lib -lfreetype -lz -lstdc++ -lm - 
o build/lib.macosx-10.3-fat-2.5/matplotlib/ft2font.so -Wl,- 
framework,CoreServices,-framework,ApplicationServices
ld: in /sw/lib/libJPEG.dylib, file is not of required architecture for 
architecture ppc
collect2: ld returned 1 exit status
lipo: can't open input file: /var/folders/U8/U8oYQjnOFIi8el0mQQiHaU++ 
+TI/-Tmp-//ccnXDZp3.out (No such file or directory)
ld: in /sw/lib/libJPEG.dylib, file is not of required architecture for 
architecture ppc
collect2: ld returned 1 exit status
lipo: can't open input file: /var/folders/U8/U8oYQjnOFIi8el0mQQiHaU++ 
+TI/-Tmp-//ccnXDZp3.out (No such file or directory)
error: Command "g++ -arch i386 -arch ppc -isysroot /Developer/SDKs/ 
MacOSX10.4u.sdk -g -bundle -undefined dynamic_lookup build/ 
temp.macosx-10.3-fat-2.5/src/ft2font.o build/temp.macosx-10.3-fat-2.5/ 
src/mplutils.o build/temp.macosx-10.3-fat-2.5/CXX/cxx_extensions.o 
build/temp.macosx-10.3-fat-2.5/CXX/cxxsupport.o build/temp.macosx-10.3- 
fat-2.5/CXX/IndirectPythonInterface.o build/temp.macosx-10.3-fat-2.5/ 
CXX/cxxextensions.o -L/usr/X11/lib -L/sw/lib/freetype219/lib -L/usr/ 
local/lib -L/usr/lib -L/sw/lib -L/usr/X11R6/lib -lfreetype -lz -lstdc+ 
+ -lm -o build/lib.macosx-10.3-fat-2.5/matplotlib/ft2font.so -Wl,- 
framework,CoreServices,-framework,ApplicationServices" failed with 
exit status 1
any ideas what is causing this premature exit?
thanks
From: Chris B. <Chr...@no...> - 2008年03月29日 00:42:29
Chris Barker wrote:
> Hi all,
> 
> I'm having an odd issue with the wxAgg back-end:
Update:
If I remove:
matplotlib/backends/_wxagg.pyd
The problem goes away.
It looks like that pyd is getting loaded even though I'm running wxPython2.8
However, now I get a non-valid png when I do savefig....
-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: Chris B. <Chr...@no...> - 2008年03月29日 00:36:09
Hi all,
I'm having an odd issue with the wxAgg back-end:
windows XP
python 2.5.2 (from python.org)
wxPython 2.8.7.1 unicode (binary from wxPython.org)
MPL 0.91.2 (binary from MPl site)
when I run:
import matplotlib
matplotlib.use('wxagg')
import pylab
I get a popup dialog:
"This application failed to start because wxmsw26uh_vc.dll was not found"
It looks like it is looking for a wxPython2.6 dll, which it doesn't 
find, because I'm running wxPython2.8
I'm guessing this binary was compiled against wxPython2.6, but I thought 
the current wxAgg back-end didn't try to use the accelerated module for 
wxPython2.8.
Any ideas?
By the way, there are a number of other small bugs cropping up in the 
pylab window with wxagg too -- but I'll look at those once I solve this.
Is no one else using MPL with wxPython2.8?
-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: John H. <jd...@gm...> - 2008年03月28日 16:17:49
On Fri, Mar 28, 2008 at 8:20 AM, Matthias Michler
<Mat...@gm...> wrote:
> On Friday 28 March 2008 13:57, Chris Withers wrote:
> > Matthias Michler wrote:
> > > I'm not sure it is the easiest way, but it works for me:
> > >
> > > for label in ax.xaxis.get_majorticklabels():
> > > label.set_rotation(+90)
> >
> > Yes, that's what I was using, just wondered if there was a better way...
>
> At least I don't know a better way, but I'm not an expert.
>
>
> > >> Also, how would I get this kind of updating with bar charts or
> > >> errorbars?
> > >
> > > In the case of bar charts and errorbars it is quite difficult to reset
> > > the data.
> >
> > Oh, I also meant to ask about scatter, can the data be easilly reset there?
>
> Scatter returns a line collection and I don't know if there is a method to
> reset their x/ydata.
We do not have good built in support for this kind of thing (though we
should add it). One approach is to write a custom artist, as in this
example. I'm using GTK only for the idle handling callback, but you
can use whatever approach works for you. The important part is the
example showing how to write a custom artist for dynamic data:
import gtk
import numpy as np
import matplotlib
matplotlib.use('GTKAgg')
import matplotlib.pyplot as plt
import matplotlib.artist as artist
import matplotlib.colors as colors
import matplotlib.agg as agg
class DynamicMarkers(artist.Artist):
 def __init__(self, buffersize=30):
 artist.Artist.__init__(self)
 self.buffersize = buffersize
 self.x = []
 self.y = []
 self.count = 0
 self.path = None
 self.markersize = 10.
 self.facecolor = colors.colorConverter.to_rgb('blue')
 self.edgecolor = colors.colorConverter.to_rgb('black')
 def add(self, x, y):
 self.count+=1
 self.x.append(x)
 self.y.append(y)
 if self.count>self.buffersize:
 del self.x[0]
 del self.y[0]
 def draw(self, renderer):
 if self.axes is None:
 raise RuntimeError('you must first add me to the axes')
 if self.path is None:
 # use square markers
 side = renderer.points_to_pixels(self.markersize)
 offset = side*0.5
 path = agg.path_storage()
 path.move_to(-offset, -offset)
 path.line_to(-offset, offset)
 path.line_to(offset, offset)
 path.line_to(offset, -offset)
 path.end_poly()
 self.path = path
 gc = renderer.new_gc()
 self._set_gc_clip(gc) # Artist method
 gc.set_foreground(self.edgecolor)
 renderer.draw_markers(gc, self.path, self.facecolor, self.x,
self.y, self.get_transform())
fig = plt.figure()
ax = fig.add_subplot(111)
myline = DynamicMarkers(30)
ax.add_artist(myline)
ax.set_xlim(-20, 1)
ax.set_ylim(0,1)
def animate(*args):
 i = animate.i
 print 'animate', i
 myline.add(i, np.random.rand())
 ax.set_xlim(i-30, i+1)
 fig.canvas.draw()
 animate.i += 1
 if animate.i<200: return True
 else: return False
gtk.idle_add(animate)
animate.i = 0
plt.show()
From: Ryan D. <rya...@UD...> - 2008年03月28日 15:24:22
Chris Withers wrote:
>> So, basically make the x axis time instead of numbers.
>> I think the problem is actually that the daets are quite long in their
>> format. If they were rotated through 90 degress it'd likely be fine.
>> How would I do this?
> 
> I'm not sure it is the easiest way, but it works for me:
> 
> for label in ax.xaxis.get_majorticklabels():
> label.set_rotation(+90)
To adjust tick labels when using dates, you could also try 
Figure.autofmt_xdate (I added it to the example code you were using 
below). Internally it sets the rotation of the xticklabels as described 
above, but also sets horizontal alignment of the labels and is 
especially useful if you have multiple subplots.
-Ryan
from datetime import datetime
from time import sleep
ion() # interactive mode 'on'
fig = figure()
ax = fig.add_subplot(111, autoscale_on=True)
x, y = [datetime.now()], [0]
line = plot(x, y, label="my_data")[0]
# get the line-object as the first element
# of the tuple returned by plot legend()
for i in arange(30):
 x.append(datetime.now()) # append new values
 y.append(i**2)
 line.set_data(x,y) # reset data
 ax.relim() # reset axes limits
 ax.autoscale_view() # rescale axes
 fig.autofmt_xdate() # adjust the xtick labels
 draw() # redraw current figure
 sleep(0.3) # wait 0.3 seconds
ioff()
show()
From: Chiara C. <chi...@ho...> - 2008年03月28日 13:29:26
I am not sure how should I use it.... any hints?
----------------------------------------
> From: jgo...@gm...
> To: mat...@li...
> Subject: Re: [Matplotlib-users] Polygon masking possible?
> Date: 2008年3月14日 18:03:13 +0000
> CC: chi...@ho...
> 
> On Friday 14 March 2008 16:44:54 Chiara Caronna wrote:
>> I tried ds9 and It looks like this is what I would like to do (though I
>> couldn't try funtools, but what you describe is good). DO you think it is
>> possible to make something like this with matplotlib? Thanks a lot for your
> 
> The initiating thread (from January) had some suggestions. In particular, some 
> code that does this from Rob Hetland: 
> 
> 
> Hope that helps,
> Jose
_________________________________________________________________
Discover the new Windows Vista
http://search.msn.com/results.aspx?q=windows+vista&mkt=en-US&form=QBRE
From: Matthias M. <Mat...@gm...> - 2008年03月28日 13:20:49
On Friday 28 March 2008 13:57, Chris Withers wrote:
> Matthias Michler wrote:
> > I'm not sure it is the easiest way, but it works for me:
> >
> > for label in ax.xaxis.get_majorticklabels():
> > label.set_rotation(+90)
>
> Yes, that's what I was using, just wondered if there was a better way...
At least I don't know a better way, but I'm not an expert.
> >> Also, how would I get this kind of updating with bar charts or
> >> errorbars?
> >
> > In the case of bar charts and errorbars it is quite difficult to reset
> > the data.
>
> Oh, I also meant to ask about scatter, can the data be easilly reset there?
Scatter returns a line collection and I don't know if there is a method to 
reset their x/ydata.
> For bar charts and errorbar plots, I agree ;-) How would I just blank
> the figure and replot?
I'm not sure, but maybe clf() to clear the whole figure and cla() to clear the 
axes does the job.
> (I have just been calling errorbar lots, but I'm guessing that if I add
> a legend, I'll have one entry for each time I called errorbar :-S)
regards,
Matthias
From: Chris W. <ch...@si...> - 2008年03月28日 12:57:32
Matthias Michler wrote:
> I'm not sure it is the easiest way, but it works for me:
> 
> for label in ax.xaxis.get_majorticklabels():
> label.set_rotation(+90)
Yes, that's what I was using, just wondered if there was a better way...
>> Also, how would I get this kind of updating with bar charts or errorbars?
> 
> In the case of bar charts and errorbars it is quite difficult to reset the 
> data. 
Oh, I also meant to ask about scatter, can the data be easilly reset there?
For bar charts and errorbar plots, I agree ;-) How would I just blank 
the figure and replot?
(I have just been calling errorbar lots, but I'm guessing that if I add 
a legend, I'll have one entry for each time I called errorbar :-S)
cheers,
Chris
-- 
Simplistix - Content Management, Zope & Python Consulting
 - http://www.simplistix.co.uk
From: Lionel R. <lro...@li...> - 2008年03月28日 11:13:11
You can use the scipy version:
|~|[10]>from scipy.stats import stats
|~|[11]>stats.scoreatpercentile(x,50)
Out [11]:7.5
Le vendredi 28 mars 2008, David Simpson a écrit :
> I would like to find percentiles, with interpolation where needed, but
> the matplotlib prctile seems to be different to matlab in this respect:
>
> In [1]: x = array([ 3.0, 5.0, 7.0, 8.0, 9.0, 11.0 ])
>
> In [2]: median(x)
> Out[2]: 7.5
>
> In [3]: prctile(x,50)
> Out[3]: 8.0
>
>
> is there a function available which does include interpolation, or
> should I just write my own? (I'd also like 10th and 90th percentiles for
> example).
>
> Thanks, Dave
>
> -------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplac
>e _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
-- 
Lionel Roubeyrie - lro...@li...
Chargé d'études et de maintenance
LIMAIR - la Surveillance de l'Air en Limousin
http://www.limair.asso.fr
From: David S. <dav...@rs...> - 2008年03月28日 10:52:54
I would like to find percentiles, with interpolation where needed, but 
the matplotlib prctile seems to be different to matlab in this respect:
In [1]: x = array([ 3.0, 5.0, 7.0, 8.0, 9.0, 11.0 ])
In [2]: median(x)
Out[2]: 7.5
In [3]: prctile(x,50)
Out[3]: 8.0
is there a function available which does include interpolation, or 
should I just write my own? (I'd also like 10th and 90th percentiles for 
example).
Thanks, Dave
From: Matthias M. <Mat...@gm...> - 2008年03月28日 09:46:32
Hello Chris,
Hello list,
On Thursday 27 March 2008 18:26, Chris Withers wrote:
> Matthias Michler wrote:
> > I'm not sure that I understand you correctly. The code I refering is the
> > one which I attached some mails ago. The following works for me:
>
> Ah, okay, to get the problem I was having, change your script as follows:
> > -------------------------------------------------------------------------
> >-------- from pylab import *
> >
> > from datetime import datetime
> >
> > from time import sleep
> >
> > ion() # interactive mode 'on'
> > figure()
> > ax = subplot(111, autoscale_on=True)
> >
> > x, y = [datetime.now()], [0]
> > line = plot(x, y, label="my_data")[0]
> > # get the line-object as the first
> > element # of the tuple returned by plot legend()
> > for i in arange(30):
> > x.append(datetime.now()) # append new values
> > y.append(i**2)
> > line.set_data(x,y) # reset data
> > ax.relim() # reset axes limits
> > ax.autoscale_view() # rescale axes
> > draw() # redraw current figure
> > sleep(0.3) # wait 0.3 seconds
> >
> > ioff()
> > show()
>
> So, basically make the x axis time instead of numbers.
> I think the problem is actually that the daets are quite long in their
> format. If they were rotated through 90 degress it'd likely be fine.
> How would I do this?
I'm not sure it is the easiest way, but it works for me:
for label in ax.xaxis.get_majorticklabels():
 label.set_rotation(+90)
> Also, how would I get this kind of updating with bar charts or errorbars?
In the case of bar charts and errorbars it is quite difficult to reset the 
data. 
e.g. errobar (from the docstring) 
Return value is a length 3 tuple. The first element is the
 Line2D instance for the y symbol lines. The second element is
 a list of error bar cap lines, the third element is a list of
 line collections for the horizontal and vertical error ranges
I think it is quite expensive to reset all x/ydata of the lines by yourself 
and I have no idea how to reset data of line collections.
I would replot the errorbars, but maybe somebody else knows a good way to 
reset the data of errorbars.
regards 
Matthias
From: John <was...@gm...> - 2008年03月28日 01:03:27
Hello, could someone please help me understand a strange problem, possibly
associated with PYTHONPATH. When I import matplotlib, pylab, or scipy from
any directory other than the root installation directory, it fails. However,
if I'm in the python installation directory there are no errors. Thanks in
advance! Please see below:
*[jfb@andLinux ~]$ python*
Python 2.5.1 (r251:54863, Mar 7 2008, 04:10:12)
[GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import scipy
Traceback (most recent call last):
 File "<stdin>", line 1, in <module>
 File "/usr/lib/python2.5/site-packages/scipy/__init__.py", line 18, in
<module>
 import pkg_resources as _pr # activate namespace packages (manipulates
__path__)
 File "/usr/lib/python2.5/site-packages/pkg_resources.py", line 2581, in
<module>
 add_activation_listener(lambda dist: dist.activate())
 File "/usr/lib/python2.5/site-packages/pkg_resources.py", line 640, in
subscribe
 callback(dist)
 File "/usr/lib/python2.5/site-packages/pkg_resources.py", line 2581, in
<lambda>
 add_activation_listener(lambda dist: dist.activate())
 File "/usr/lib/python2.5/site-packages/pkg_resources.py", line 2130, in
activate
 map(declare_namespace, self._get_metadata('namespace_packages.txt'))
 File "/usr/lib/python2.5/site-packages/pkg_resources.py", line 1749, in
declare_namespace
 _handle_ns(packageName, path_item)
 File "/usr/lib/python2.5/site-packages/pkg_resources.py", line 1712, in
_handle_ns
 module = sys.modules[packageName] = new.module(packageName)
AttributeError: 'module' object has no attribute 'module'
>>>
*[jfb@andLinux ~]$ cd /usr/lib/python2.5/
[jfb@andLinux python2.5]$ python*
Python 2.5.1 (r251:54863, Mar 7 2008, 04:10:12)
[GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import scipy
>>>
*[jfb@andLinux python2.5]$ cd
[jfb@andLinux ~]$ echo $PYTHONPATH*
:.:/usr/lib/python2.5/:.:/home/jfb/bin
*[jfb@andLinux ~]$*
From: Andrew C. <ac...@gm...> - 2008年03月28日 00:09:40
Attachments: test_case.py
Quiver doesn't seem to be able to handle begin passed zeros for the
vector lengths. The full error output is below. I'm running Leopard
with macpython 2.5.2 using
matplotlib-0.91.2-py2.5-macosx-10.3-i386.egg
The following code does not work:
rx = numpy.array([0.0,0.0])
ry = numpy.array([1.0,-1.0])
ax = numpy.array([0.0,0.0])
ay = numpy.array([0.0,0.0])
quiver(rx,ry,ax,ay)
savefig("image2.png",format='png')
The same code works if any of ax or ay are nonzero.
Cheers,
Andrew Charles
-----------------------------------
Error output:
spinode: ./test_case.py
Traceback (most recent call last):
 File "./test_case.py", line 24, in <module>
 savefig("image2.png",format='png')
 File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib-0.91.2-py2.5-macosx-10.3-i386.egg/matplotlib/pyplot.py",
line 269, in savefig
 return fig.savefig(*args, **kwargs)
 File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib-0.91.2-py2.5-macosx-10.3-i386.egg/matplotlib/figure.py",
line 782, in savefig
 self.canvas.print_figure(*args, **kwargs)
 File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib-0.91.2-py2.5-macosx-10.3-i386.egg/matplotlib/backends/backend_wxagg.py",
line 101, in print_figure
 FigureCanvasAgg.print_figure(self, filename, *args, **kwargs)
 File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib-0.91.2-py2.5-macosx-10.3-i386.egg/matplotlib/backend_bases.py",
line 1201, in print_figure
 self.figure.canvas.draw()
 File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib-0.91.2-py2.5-macosx-10.3-i386.egg/matplotlib/backends/backend_wxagg.py",
line 61, in draw
 FigureCanvasAgg.draw(self)
 File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib-0.91.2-py2.5-macosx-10.3-i386.egg/matplotlib/backends/backend_agg.py",
line 358, in draw
 self.figure.draw(self.renderer)
 File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib-0.91.2-py2.5-macosx-10.3-i386.egg/matplotlib/figure.py",
line 624, in draw
 for a in self.axes: a.draw(renderer)
 File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib-0.91.2-py2.5-macosx-10.3-i386.egg/matplotlib/axes.py",
line 1345, in draw
 a.draw(renderer)
 File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib-0.91.2-py2.5-macosx-10.3-i386.egg/matplotlib/quiver.py",
line 336, in draw
 verts = self._make_verts(self.U, self.V)
 File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib-0.91.2-py2.5-macosx-10.3-i386.egg/matplotlib/quiver.py",
line 386, in _make_verts
 length = a/(self.scale*self.width)
 File "/Library/Python/2.5/site-packages/numpy/ma/core.py", line
1679, in __div__
 return divide(self, other)
 File "/Library/Python/2.5/site-packages/numpy/ma/core.py", line 614,
in __call__
 numpy.putmask(d2, t, self.filly)
From: Christopher B. <Chr...@no...> - 2008年03月27日 22:13:11
Ronald Oussoren wrote:
> That load command is for LC_UUID. The version of macholib in subversion 
> should have some support that is (basicly ignoring the entire load 
> command because macholib won't have to change it), could you test that 
> (easy_install macholib==dev)?
Yup, that problem is solved. Now it complains that I don't have wxPython 
libs, so I guess I need to make sure to import it explicitly, rather 
than letting matplotlib do it for me, so py2app will find it.
I got this error at some point:
/usr/bin/strip: the __LINKEDIT segment does not cover the end of the 
file (can't be processed) in: 
/Users/cbarker/HAZMAT/SmallToolsSVN/phCalculator/trunk/dist/test.app/Contents/Frameworks/libncurses.5.dylib 
(for architecture i386)
But it seems to work -- is that a problem? And I don't know why I need 
ncurses anyway!
So, in summary:
with the latest py2app and removing the pytz line from the recipe, I 
have py2app working with MPL. Note that I'm not doing anything with 
time, so I don't know if there is a pytz problem or not.
-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: Gerolf Z. <ger...@go...> - 2008年03月27日 19:48:32
Hi,
Thanks for all the replies! Of course it is not directly a bug. But
awkward. This is how I was finally able to change alle fonts and the
whole layout of the plot:
fig_width_pt = 246.0 # Get this from LaTeX using \showthe\columnwidth
inches_per_pt = 1.0/72.27 # Convert pt to inch
golden_mean = (sqrt(5)-1.0)/2.0 # Aesthetic ratio
fig_width = fig_width_pt*inches_per_pt # width in inches
fig_height = fig_width*golden_mean # height in inches
fig_size = [fig_width,fig_height]
params = {'backend': 'ps','axes.labelsize': 10,'text.fontsize': 10,'legend.fontsize': 10,'text.usetex': True,'text.latex.preamble':["\usepackage{bm}","\usepackage{textcomp}"], 'figure.figsize': fig_size, 'font.family' : 'sans-serif', 'font.style': 'normal', 'font.weight':'normal',}
rcParams.update(params)
.......
ffont = {'family':'sans-serif','fontsize':10,'weight':'bold'}
ax1=gca()
ax1.set_xticklabels(ax1.get_xticks(),ffont)
ax1.set_yticklabels(ax1.get_yticks(),ffont)
subplots_adjust(top=1-.13)
xticks(**ffont)
yticks(**ffont)
Best regards:
 Gerolf
On Thu 27.Mar.08 14:54, Darren Dale wrote:
> On Thursday 27 March 2008 01:27:28 pm Gerolf Ziegenhain wrote:
> > More complete:
> >
> > I tried all permunations of backends. Now I stick to PS, because I use
> > matplotlib from commandline with scripts. The environment is debian/etch
> > with a current version of matplotlib (self compiled).
> >
> > Try this script
> > ********************************************
> > from pylab import *
> >
> > t = arange(0.0, 2.0, 0.01)
> > s = sin(2*pi*t)
> > plot(t, s)
> > grid(True)
> >
> > # matlab handle graphics style
> > xticklines = getp(gca(), 'xticklines')
> > yticklines = getp(gca(), 'yticklines')
> > xgridlines = getp(gca(), 'xgridlines')
> > ygridlines = getp(gca(), 'ygridlines')
> > xticklabels = getp(gca(), 'xticklabels')
> > yticklabels = getp(gca(), 'yticklabels')
> >
> > setp(xticklines, 'linewidth', 3)
> > setp(yticklines, 'linewidth', 3)
> > setp(xgridlines, 'linestyle', '-')
> > setp(ygridlines, 'linestyle', '-')
> > setp(yticklabels, 'color', 'r', fontsize='medium')
> > setp(xticklabels, 'color', 'r', fontsize='medium', family='sans-serif')
> >
> > savefig('axprops_demo')
> > ******************************************
> >
> > On my system the line
> > setp(xticklabels, 'color', 'r', fontsize='medium', family='sans-serif')
> > doesn't change the font family.
> 
> Do you use "usetex"? If you do, the mathtext is rendered using latex, and 
> latex renders mathtext in serif fonts.
> 
> Darren
> 
> -------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
-- 
Dipl. Phys. Gerolf Ziegenhain 
Web: http://gerolf.ziegenhain.com
Email: mai...@zi...
Fax: +49 611 18840599
Phone: +49 611 18840590
Office: Erwin-Schrödinger-Str. 46 / Room 46.332 / 67663 Kaiserslautern / Germany
Private: Klopstockstr. 21 / 65187 Wiesbaden / Germany
From: Ryan K. <rya...@gm...> - 2008年03月27日 19:00:59
I guess you could read the rcParams value that corresponds to the
screen display and set rcParams['savefig.dpi'] to that value (this
might work):
mydpi = rcParams['figure.dpi']
rcParams['savefig.dpi'] = mydpi
But that seems slightly hackish and maybe not much more elegant than
what you are currently doing with passing dpi into savefig.
FWIW,
Ryan
On Thu, Mar 27, 2008 at 1:57 PM, Christopher Barker
<Chr...@no...> wrote:
> Ryan Krauss wrote:
> > I think this line in the rc file is the trick
> >
> > #savefig.dpi : 100
>
> nope. I think all that does is set the default dpi for savefig. I don't
> want any default, I want it to use the same dpi that is being used for
> display, and I don't know ahead of time what that is, I expect it is
> system dependent.
>
> Or do you mean that if I comment out that line, it will default to the
> one already in use? In which case, I need to go figure out how to change
> that in code, rather than messing with my matplotlibrc.
>
>
>
> -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...
>
> -------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: Darren D. <dar...@co...> - 2008年03月27日 18:54:17
On Thursday 27 March 2008 01:27:28 pm Gerolf Ziegenhain wrote:
> More complete:
>
> I tried all permunations of backends. Now I stick to PS, because I use
> matplotlib from commandline with scripts. The environment is debian/etch
> with a current version of matplotlib (self compiled).
>
> Try this script
> ********************************************
> from pylab import *
>
> t = arange(0.0, 2.0, 0.01)
> s = sin(2*pi*t)
> plot(t, s)
> grid(True)
>
> # matlab handle graphics style
> xticklines = getp(gca(), 'xticklines')
> yticklines = getp(gca(), 'yticklines')
> xgridlines = getp(gca(), 'xgridlines')
> ygridlines = getp(gca(), 'ygridlines')
> xticklabels = getp(gca(), 'xticklabels')
> yticklabels = getp(gca(), 'yticklabels')
>
> setp(xticklines, 'linewidth', 3)
> setp(yticklines, 'linewidth', 3)
> setp(xgridlines, 'linestyle', '-')
> setp(ygridlines, 'linestyle', '-')
> setp(yticklabels, 'color', 'r', fontsize='medium')
> setp(xticklabels, 'color', 'r', fontsize='medium', family='sans-serif')
>
> savefig('axprops_demo')
> ******************************************
>
> On my system the line
> setp(xticklabels, 'color', 'r', fontsize='medium', family='sans-serif')
> doesn't change the font family.
Do you use "usetex"? If you do, the mathtext is rendered using latex, and 
latex renders mathtext in serif fonts.
Darren
From: Christopher B. <Chr...@no...> - 2008年03月27日 18:54:08
Ryan Krauss wrote:
> I think this line in the rc file is the trick
> 
> #savefig.dpi : 100
nope. I think all that does is set the default dpi for savefig. I don't 
want any default, I want it to use the same dpi that is being used for 
display, and I don't know ahead of time what that is, I expect it is 
system dependent.
Or do you mean that if I comment out that line, it will default to the 
one already in use? In which case, I need to go figure out how to change 
that in code, rather than messing with my matplotlibrc.
-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: Michael D. <md...@st...> - 2008年03月27日 18:46:12
Christopher Barker wrote:
> Michael Droettboom wrote:
> 
>> I think the real reason this wasn't done is that its tricky to do at the 
>> C level in a cross-platform way. At present it uses the regular POSIX 
>> fopen in C, which isn't really "Unicode aware".
>> 
>
> The actual error is from trying to put the filename in a std::string, 
> 
Presumably because it doesn't decode into ASCII.
> but yes, I'm sure the fopen issue is the driver. Does C++ offer anything 
> better?
> 
Not in the C++ standard library in a cross platform way, that I'm aware 
of. All three platforms (if you include Gtk, Qt etc.) have special 
Unicode-aware APIs, and each deals with things differently. The 
approach I took basically leverages all the trouble the Python core guys 
put into to make this work cross-platform.
> See the "Unicode
> 
>> filenames" section of the link below for some of the complications. 
>> Linux is particularly hard to get right:
>>
>> http://www.amk.ca/python/howto/unicode
>> 
>
> Thanks, that's a good one.
>
> > you can do the following as a workaround
> 
>> (with a performance hit from making many Python function calls):
>>
>> savefig(open(u"CrazyUnicodeFilename.png", "w"))
>> 
>
> thanks, I'll give that a try. I'm confused, though, why the many Python 
> function calls? the C++ code doesn't just grab the file pointer?
> 
No -- a while back, it was segfaulting when trying to do that (but I've 
since figured out why -- it was a reference counting problem). In 
0.91.2, it calls the "write" method on the Python object for each block 
of PNG data. SVN still supports that approach (to handle arbitrary 
Python file-like objects), but will extract the real C file handle if it 
is in fact a real file.
Mike
-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA
4 messages has been excluded from this view by a project administrator.

Showing results of 450

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