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





Showing results of 267

<< < 1 .. 4 5 6 7 8 .. 11 > >> (Page 6 of 11)
From: Robert L. <ro...@le...> - 2005年02月14日 23:12:13
I'd like to be able to generate a png with a transparent background so that I 
can overly multiple graphs on top of each other (in a web page). I've tried the 
frameOn-False discussed a couple of times in the mailing list it doesn't produce 
the desired result.
Is this possible?
Robert
From: John H. <jdh...@ac...> - 2005年02月14日 23:02:56
>>>>> "Robert" == Robert Leftwich <ro...@le...> writes:
 Robert> the resulting tkagg or png output has the triangles
 Robert> pointing in odd directions (sometimes even at 45 degrees).
On line 238 in collection.py, flip the sin and cos order
 self._verts = zip( r*sin(theta), r*cos(theta) )
This was correct in 0.71 but I undid it (wrongly) in 0.72 because the
sin and cos looked to be in the wrong order and I assumed it was a
bug. Now I realize there was a method to my madness, because 0
degrees is pointing up and not to the right....
 
Something for the bug-fix release! Thanks for the report.
JDH
From: Robert L. <ro...@le...> - 2005年02月14日 22:48:37
I've just upgraded to 0.7.2 (Python 2.4 on windows) and I'm seeing strange 
behaviour with the scatter plot markers. If I run the scatter_demo.py and change 
the marker to use any of the triangles:
 '^' : triangle up
 '>' : triangle right
 'v' : triangle down
 '<' : triangle left
the resulting tkagg or png output has the triangles pointing in odd directions 
(sometimes even at 45 degrees).
Robert
From: Joe J. <jo...@th...> - 2005年02月14日 22:09:15
On Sunday 13 February 2005 8:21 pm, John Hunter wrote:
> Hey Joe, thanks for the detailed info. These kinds of bugs are very
> hard to track down since I can't replicate them. A few suggestions.
> rm -rf your "build" sub-directory *and* site-packages/matplotlib and
> get a clean install to make sure there is no lingering old code
> linking to the old freetype. Make sure you have a pretty recent
> freetype (eg >= 2.1.7). What version *are* you using?
>
Hi, thanks for the quick responce. Turns out that this is a bug in gcc. By 
default freetype builds with the -O2 option, needs to be -O0. Apparently this 
is fixed in newer versions of gcc, I'm using "3.3.1 (SuSE Linux)".
It looks like other programs such as KDE and Mozilla don't tread on this bug. 
Well, if its true that ldd doesn't lie.
Cheers
Joe
From: John H. <jdh...@ac...> - 2005年02月14日 19:28:02
matplotlib-0.72 is up at the sourceforge site. Note that there have
been some signficant changes at the extension code level. If you get
crashes or segfaults on import or usage, try deleting the "build"
subsirectory and site-packages/matplotlib before reinstalling to
insure a clean install.
 - heavy optimizations in line marker drawing eg plot(x,y,'+') or any
 other line marker. Here are some numbers, where N is the number
 of symbols
 
 0.71 0.72 speedup
 -----------------------------------
 N = 1000 | 0.24s | 0.13s | 1.85x
 N = 5000 | 0.68s | 0.19s | 3.57x
 N = 10000 | 1.17s | 0.28s | 4.19x
 N = 50000 | 5.30s | 0.60s | 8.89x
 N = 100000 | 10.02s | 0.70s | 14.31x
 N = 500000 | 48.81s | 2.32s | 21.03x
 - lots of work making log plots "just work". You can toggle log y
 axes with the 'l' command -- nonpositive data are simply ignored
 and no longer raise exceptions. log plots should be a lot faster
 and more robust
 - fixed a contour bug for unequal sized arrays and made the syntax
 matlab compatible -- see http://matplotlib.sf.net/API_CHANGES
 - alpha version of QTAgg backend -- note the licensing issue of QT is
 murky since QT is dual licensed. If you are shipping a commercial
 product with matplotlib you may want to remove the qt backend to be
 on the safe side.
 - matshow for displaying arrays with proper aspect ratio -- see
 http://matplotlib.sf.net/matplotlib.pylab.html#-mathshow
 - new examples/interactive.py which shows you how to use matplotlib
 in a custom gtk shell
 - shared axes for two scale and ganged plots -- you can set sharex on
 and axis and multiple subpolots will pan and zoom together. See
 http://matplotlib.sf.net/examples/shared_axis_demo.py - Thanks Baptiste!
 - Default key presses over axes: 'g' toggles grid, 'l' toggles logy
 - little features: calls to subplot with overlap other subplots now
 delete the overlapped subplot, load and save work with file and
 handles gzipped files transaparently, small PS optimizations, gtk
 figure resizing more flexible
 - little bug fixes: contour datalim and unequal sized array bugs,
 mx2num, added missing mathtext symbols, fonts in mathtext
 super/subscripts, contour works with interactive changes in cmaps,
 clim
Special thanks to Fernando Perez for many CVS bug reports, feature
suggestions and contributions.
http://matplotlib.sf.net
JDH
From: daniele <dga...@gm...> - 2005年02月14日 18:53:12
Thank you very much for your advice.
Unfortunately when I try to run the script I get:
 File "C:\Python24\Lib\site-packages\pythonwin\pywin\framework\scriptutils=
.py",
line 310, in RunScript
 exec codeObject in __main__.__dict__
 File "C:\Python24\MathPlot_examples\examples\embedding_in_wx3.py",
line 156, in ?
 app =3D MyApp(0)
 File "C:\Python24\Lib\site-packages\wx-2.5.3-msw-ansi\wx\_core.py",
line 5301, in __init__
 self._BootstrapApp()
 File "C:\Python24\Lib\site-packages\wx-2.5.3-msw-ansi\wx\_core.py",
line 4980, in _BootstrapApp
 return _core_.PyApp__BootstrapApp(*args, **kwargs)
 File "C:\Python24\MathPlot_examples\examples\embedding_in_wx3.py",
line 111, in OnInit
 self.panel =3D XRCCTRL(self.frame,"MainPanel")
 File "C:\Python24\Lib\site-packages\wx-2.5.3-msw-ansi\wx\xrc.py",
line 203, in XRCCTRL
 return window.FindWindowById(XRCID(str_id))
AttributeError: 'NoneType' object has no attribute 'FindWindowById'
Which frankly I don=B4t understand. Any further advice?
Thank you,
DG
From: John H. <jdh...@ac...> - 2005年02月14日 14:39:07
>>>>> "Eugen" == Eugen Wintersberger <eug...@jk...> writes:
 Eugen> Hi there I use matplotlib from within ipyton (simply by
 Eugen> calling $ipython -pylab in a shell window). I'm using the
 Eugen> debian packages as mentioned on the matplotlib homepage on
 Eugen> a Debian sarge system. Everything works fine except the
 Eugen> semilogy command behaves a bit strange (I'm new to
 Eugen> matplotlib so it is maybe my mistake). After starting
 Eugen> ipython in pylab mode I do the following:
What is happening is a little complicated, but it is a know limitation
of 0.71. The problem is that the autoscaler set the axis limits to
include zero (which it shouldn't) and the log transformer works on
tick locations too. That's where the log of zero came in. 
Good news for you -- a lot of work has gone into making log scaling
*just work* in CVS. You can toggle between log and linear y axes by
pressing 'l' with your mouse over the axes, nonpositive data points
are dropped, the autoscaler keeps track of your least positive data
point and will auto set the view limits accordingly.
The release is due out today -- stay tuned...
JDH
From: John H. <jdh...@ac...> - 2005年02月14日 14:35:37
>>>>> "Fl=E1vio" =3D=3D Fl=E1vio Code=E7o Coelho <fcc...@fi...> wr=
ites:
 Fl=E1vio> I just want to let you know that neither 'cla', 'clf' nor
 Fl=E1vio> 'figure' solved the issue but 'close' did it. I must
 Fl=E1vio> point out that the only element that was being carried out
 Fl=E1vio> from figure to figure was the colorbar, not the plot
 Fl=E1vio> itself. Apparently 'close' is the only one of these
 Fl=E1vio> functions that gets rid of the colorbar.
Hi Fl=E1vio,
clf *should* work. Could you send me a script which includes a clf
that replicates the problem so I can fix it. Thanks.
JDH
From: Eugen W. <eug...@jk...> - 2005年02月14日 13:34:11
Hi there
 I use matplotlib from within ipyton (simply by calling $ipython -pylab
in a shell window). I'm using the debian packages as mentioned on the
matplotlib homepage on a Debian sarge system. 
Everything works fine except the semilogy command behaves a bit strange
(I'm new to matplotlib so it is maybe my mistake). 
After starting ipython in pylab mode I do the following:
In [1]: x=arrayrange(0.0,100.0);
In [2]: plot(x)
Out[2]: [<matplotlib.lines.Line2D instance at 0x4437a30c>]
until here everything works fine (I use the TkAgg interface for
interactive plotting, hold is set to False). 
If I continue now with
In [3]: semilogy(x)
---------------------------------------------------------------------------
ValueError Traceback (most recent call
last)
/home/eugen/<console>
/usr/lib/python2.3/site-packages/matplotlib/pylab.py in semilogy(*args,
**kwargs)
 2089 hold(b)
 2090 else:
-> 2091 draw_if_interactive()
 2092
 2093 hold(b)
/usr/lib/python2.3/site-packages/matplotlib/backends/__init__.py in
draw_if_interactive()
 39 def draw_if_interactive():
 40 draw_if_interactive._called = True
---> 41 __draw_int()
 42 # Flag to store state, so external callers (like ipython)
can keep track
 43 # of draw calls.
/usr/lib/python2.3/site-packages/matplotlib/backends/backend_tkagg.py in
draw_if_interactive()
 56 figManager = Gcf.get_active()
 57 if figManager is not None:
---> 58 figManager.show()
 59
 60
/usr/lib/python2.3/site-packages/matplotlib/backends/backend_tkagg.py in
show(self)
 275 # anim.py requires this
 276 if sys.platform=='win32' : self.window.update()
--> 277 else: self.canvas.draw()
 278 self._shown = True
 279
/usr/lib/python2.3/site-packages/matplotlib/backends/backend_tkagg.py in
draw(self)
 140
 141 def draw(self):
--> 142 FigureCanvasAgg.draw(self)
 143 tkagg.blit(self._tkphoto, self.renderer._renderer, 2)
 144 self._master.update_idletasks()
/usr/lib/python2.3/site-packages/matplotlib/backends/backend_agg.py in
draw(self)
 306 self.renderer = RendererAgg(w, h, self.figure.dpi)
 307 self._lastKey = key
--> 308 self.figure.draw(self.renderer)
 309
 310 def tostring_rgb(self):
/usr/lib/python2.3/site-packages/matplotlib/figure.py in draw(self,
renderer)
 332
 333 # render the axes
--> 334 for a in self.axes: a.draw(renderer)
 335
 336 # render the figure text
/usr/lib/python2.3/site-packages/matplotlib/axes.py in draw(self,
renderer)
 1167 if not self.get_visible(): return
 1168 renderer.open_group('axes')
-> 1169 self.transData.freeze() # eval the lazy objects
 1170 self.transAxes.freeze() # eval the lazy objects
 1171 if self.axison:
ValueError: Cannot take log of nonpositive value
you see what happens. Since the array starts with 0.0 the error message
is ok. But 
In [4]: x=x+1.0;
In [5]: semilogy(x)
gives the same error. 
Also a subsequent clf or cla command could not solve the problem. 
Has anyone of you an idea what is going on here (or what I'm doing
wrong)? My matplotlib version is 0.71-1.
best regards
 Eugen Wintersberger
-- 
Eugen Wintersberger <eug...@jk...>
From: <fcc...@fi...> - 2005年02月14日 11:12:54
On Saturday 12 February 2005 23:40, John Hunter wrote:
> >>>>> "Fl=E1vio" =3D=3D Fl=E1vio Code=E7o Coelho <fcc...@fi...> wr=
ites:
>
> Fl=E1vio> hi, how can I remove a colorbar?
>
> Fl=E1vio> in the following code, i generate figures that are saved
> Fl=E1vio> not shown. and with every new figure I get an extra
> Fl=E1vio> colorbar instead of an updated one!
>
> Hi Flavio,
>
> Try clearing the figure between saves with clf. Or else manage the
> different figures the "figure" and "close" commands.
>
> The default mode of matplotlib is to continue adding stuff to the same
> figure, so you need to clear axes with "cla", clear figures with
> "clf", close figures with "close", create new figures with "figure",
> and manage the hold state with "hold", "ion", "ioff" and "ishold".
> See the documentation for all of these commands at
> http://matplotlib.sf.net/matplotlib.pylab.html
>
> Hope this helps,
> JDH
>
Thanks John,
I just want to let you know that neither 'cla', 'clf' nor 'figure' solved t=
he=20
issue but 'close' did it. I must point out that the only element that was=
=20
being carried out from figure to figure was the colorbar, not the plot=20
itself. Apparently 'close' is the only one of these functions that gets rid=
=20
of the colorbar.
=46l=E1vio=20
From: Mark H. <mh...@cl...> - 2005年02月14日 02:12:36
Yes GTKAgg seems to work on my set up with pythonwin. However, i'm new to 
both python and matplotlib (installed it 3 days ago) and I haven't run all 
your test scripts yet, but the ones I've tried do work. Also it works from 
the pythonwin command prompt provided you don't go:
matplotlib.interactive(True)
This will do one plot and then GPF (but with a different message from the 
one given when using TKAgg etc). I did get some overlayed plots working from 
the command prompt yesterday but can't remember what I was doing 
differently.
BTW have set the window controls to classic in the cfg file which allows 
zoom, pan and saving to PS/Png (and the images import into Lyx (Win 32 
version) with no problems), not sure that the "newfangled" one works 
correctly - couldn't make the window zoom and pan, but maybe just 
incompetence.
Mark
P.S. I notice someone else in the list had a problem downloading the user 
guide. I had a similar problem - acrobat thinks the PDF is corrupted, but 
the alternate link you gave works fine.
----- Original Message ----- 
From: "John Hunter" <jdh...@ac...>
To: "Mark Hailes" <mh...@cl...>
Cc: <mat...@li...>
Sent: Sunday, February 13, 2005 7:48 PM
Subject: Re: [Matplotlib-users] GTKAgg Win XP
>>>>>> "Mark" == Mark Hailes <mh...@cl...> writes:
>
> Mark> Hi In case anyone has the same problem getting GTKAgg (I
> Mark> think this is the best option for use with pythonwin & Idle
> Mark> & pycrust since the default TKAgg causes GPF) to work on win
> Mark> XP, note that the current version of pyGTK for windows -
> Mark> pygtk-2.4.1-2.win32-py2.4.exe doesn't work with the versions
> Mark> of GTK available from the page linked to in the matplotlib
> Mark> faq owing to an unresolved dll reference. However,
> Mark> gtk-win32-2.6.1-rc3.exe will work. I think that GTK has some
> Mark> parallel development strands, which is confusing ...
>
> Hmm, good to know. So you're saying gtkagg works from pythonwin? That
> would be *very nice* for windows users. I'll take a look at the
> installers you are suggesting, because I've had a hard time finding an
> environment to suggest to win32 matplotlib users, particularly
> newbies. The pythonwin environment, in my opinion, is very nice for
> windows users because it has the native win32 look and feel, but I
> wasn't aware of any matplotlib backends that could be used within it
> due to GUI conflict issues. Have you tried gtkagg with this gtk
> release in win32, both in script mode (Eg "Run") and in interactive
> mode (eg entering plot commands at the shell)?
>
> JDH
>
> 
From: Humufr <hu...@ya...> - 2005年02月14日 01:09:29
>It looks like the reason the columns version of load is faster is
>because it's not doing anything...
It' not exactly true. I'm agree that the change is not big, but the 
difference comes from this two lines:
#row = [val for val in line.split()] #no change in float for all values
row = line.split() # dont need the loop so forgot the precedent line 
row = [float(row[i]) for i in columns] # float value
and in a fact there are a condition if:
the first is to keep exactly the same function than yours. The second 
part is to not transform all the element in float but only the columns 
choose and this change explain the difference...
Regards,
 Nicolas
From: Darren D. <dd...@co...> - 2005年02月13日 20:48:20
I noticed that when I do something like 
pylab.title(r'$\rm{MnO}_{2}$')
that the text is rendered with small variation in the alignment of the 
characters. In the example linked below, the lower-case letters in the title 
appear to be offset.
http://people.ccmr.cornell.edu/~dd55/matplotlib.html
I end up exporting .eps files, and there the rendering is normal. Has anyone 
else noticed this effect?
(By the way, nice work on the log-scale formatter, John. Now the tick-label 
fonts match in a semilog plot.) 
-- 
Darren
From: John H. <jdh...@ac...> - 2005年02月13日 20:31:48
>>>>> "Joe" == Joe Jones <jo...@th...> writes:
 Joe> As this problem looks font related I should mention that
 Joe> there are two versions of freetype2 on my system (Suse
 Joe> 9.0). one in /usr/lib that came with my system, and one in
 Joe> /usr/local that I installed myself. I unistalled the
 Joe> headerfiles and static libs of the one which came with the
 Joe> system. The run time linker is finding the new one, so
 Joe> matplot is compiling and linking against the same version.
Hey Joe, thanks for the detailed info. These kinds of bugs are very
hard to track down since I can't replicate them. A few suggestions.
rm -rf your "build" sub-directory *and* site-packages/matplotlib and
get a clean install to make sure there is no lingering old code
linking to the old freetype. Make sure you have a pretty recent
freetype (eg >= 2.1.7). What version *are* you using?
Once you get matplotlib reinstalled, see if you can replicate the bug.
If not, good. If so, send an ldd of
site-packages/matplotlib/ft2font.so, and see if you can reproduce the
problem with a minimal script, eg
 from matplotlib.ft2font import FT2Font
 font = FT2Font('/your/path/to/Vera.ttf')
 font.set_size(40, 150)
 font.set_text('finish it', 40)
 font.draw_glyphs_to_bitmap()
 fname = 'font.raw'
 font.write_bitmap(fname)
This will take out a lot of the unknowns. The FT2Font constructor
does call the FT_Get_Postscript_Name function, which appears to be
involved according to your gdb session.
Thanks,
JDH
From: John H. <jdh...@ac...> - 2005年02月13日 19:58:48
>>>>> "Mark" == Mark Hailes <mh...@cl...> writes:
 Mark> Hi In case anyone has the same problem getting GTKAgg (I
 Mark> think this is the best option for use with pythonwin & Idle
 Mark> & pycrust since the default TKAgg causes GPF) to work on win
 Mark> XP, note that the current version of pyGTK for windows -
 Mark> pygtk-2.4.1-2.win32-py2.4.exe doesn't work with the versions
 Mark> of GTK available from the page linked to in the matplotlib
 Mark> faq owing to an unresolved dll reference. However,
 Mark> gtk-win32-2.6.1-rc3.exe will work. I think that GTK has some
 Mark> parallel development strands, which is confusing ...
Hmm, good to know. So you're saying gtkagg works from pythonwin? That
would be *very nice* for windows users. I'll take a look at the
installers you are suggesting, because I've had a hard time finding an
environment to suggest to win32 matplotlib users, particularly
newbies. The pythonwin environment, in my opinion, is very nice for
windows users because it has the native win32 look and feel, but I
wasn't aware of any matplotlib backends that could be used within it
due to GUI conflict issues. Have you tried gtkagg with this gtk
release in win32, both in script mode (Eg "Run") and in interactive
mode (eg entering plot commands at the shell)?
JDH
From: John H. <jdh...@ac...> - 2005年02月13日 19:56:04
>>>>> "daniele" =3D=3D daniele <dga...@gm...> writes:
 daniele> Hi, I=B4m new to matplotlib. I=B4m writing a program using
 daniele> wxPython. The purpose of it is to insert some prices in a
 daniele> form and get a plot of them in a graph inside the main
 daniele> window. Is it possible to refresh the graph with the new
 daniele> values after a button is pushed? How? Thank you very
 daniele> much. DG
You want to define some function that updates the data in your plot
and then calls canvas.draw(). You can then connect that callback to
the clicked event of your button.
See, for example, embedding_in_wx3.py in the matplotlib examples
directory, which does just this (thanks Andrew!)
JDH
From: Joe J. <jo...@th...> - 2005年02月13日 18:54:57
Hi
I've just compiled and installed matplotlib 0.71. When I tried some of the 
example scripts I found that they all segfault. It's "from pylab import *" 
that does it. I'm working on linux.
Here is the output. I have VERBOSE set to true in setup.py and there is more 
output than I'm showing here.
python -c 'from pylab import *'
...
...
SeparableTransformation::SeparableTransformation
Glyph::init_type
FT2Font::init_type
font search path ['/usr/share/matplotlib']
ft2font_module::new_ft2font
FT2Font::FT2Font
FT2Font::clear
Segmentation fault
If I use gdb to get a stack trace
(gdb) where
#0 0x408059e9 in FT_Get_Postscript_Name (face=0x8170e98) at ftobjs.c:2457
#1 0x407aa61f in FT2Font (this=0x80f7d60, facefile=
 {static npos = 4294967295, _M_dataplus = {<allocator<char>> = {<No 
data fields>}, _M_p = 0x814ebb4 "/usr/share/matplotlib/VeraIt.ttf"}, static 
_S_empty_rep_storage = {0, 0, 0, 0}}) at src/ft2font.cpp:96
#2 0x407b5ded in ft2font_module::new_ft2font(Py::Tuple const&) 
(this=0x811b300, args=@0x20) at Objects.hxx:456
#3 0x407bf1ef in 
Py::ExtensionModule<ft2font_module>::invoke_method_varargs(std::string 
const&, Py::Tuple const&) (
 this=0x811b300, name=@0xbfff8e70, args=@0x60) at Extensions.hxx:283
#4 0x407c960e in method_varargs_call_handler 
(_self_and_name_tuple=0x40858e10, _args=0x4078de8c)
 at CXX/cxx_extensions.cxx:1238
As this problem looks font related I should mention that there are two 
versions of freetype2 on my system (Suse 9.0). one in /usr/lib that came with 
my system, and one in /usr/local that I installed myself. I unistalled the 
headerfiles and static libs of the one which came with the system. The run 
time linker is finding the new one, so matplot is compiling and linking 
against the same version.
If someone can give me a clue about this I would be very happy.
Joe
From: daniele <dga...@gm...> - 2005年02月13日 14:56:50
Hi,
I=B4m new to matplotlib. I=B4m writing a program using wxPython. The
purpose of it is to insert some prices in a form and get a plot of
them in a graph inside the main window. Is it possible to refresh the
graph with the new values after a button is pushed? How?
Thank you very much.
DG
From: John H. <jdh...@ac...> - 2005年02月13日 02:01:23
>>>>> "Humufr" == Humufr <hu...@ya...> writes:
 Humufr> Hi, I did some change (again) in the load
 Humufr> function to improve the speed when you're load some big
 Humufr> data file but you want use only some columns. I did all my
 Humufr> tests with a file with 9722 line and 16 columns. The
 Humufr> bench test file is after. I think that the result of the
 Humufr> bench are interesting:
 Humufr> I you want use 2 columns on the 16 the results are:
 Humufr> load matplotlib 0.58 load with columns choice 0.27 normal
 Humufr> load inside the new load version 0.58
 Humufr> We win a factor two. I know that depend totally from the
 Humufr> number of columns and that the change is not interesting
 Humufr> and more decrease the efficiency if you want use all the
 Humufr> data in your file but like the columns call is optionnal I
 Humufr> don't think that is point is crucial but I add a figure to
 Humufr> see the effect when you go to one to all the columns.
 Humufr> The load function is after.
Either there was an error i your cut and paste, or the reason your new
load function is faster is that it does nothing. Note the indentation
The second time you do "for line in fh" you clearly intend to be
handling the columns case, but it is inside the "if columns is None"
block.
It looks like the reason the columns version of load is faster is
because it's not doing anything...
JDH
 if columns is None:
 for line in fh:
 line = line[:line.find(comments)].strip()
 if not len(line): continue
 row = [float(val) for val in line.split()]
 thisLen = len(row)
 if numCols is not None and thisLen != numCols:
 raise ValueError('All rows must have the same number
of columns')
 X.append(row) else:
 for line in fh:
 line = line[:line.find(comments)].strip()
 if not len(line): continue
 row = [val for val in line.split()]
 row = [float(row[i]) for i in columns]
 thisLen = len(row)
 if numCols is not None and thisLen != numCols:
 raise ValueError('All rows must have the same number
 Humufr> Regards,
 Humufr> Nicolas
 Humufr> -----------------------------------------------
 Humufr> #!/usr/bin/env python # -*- coding: utf-8 -*-
 Humufr> from time import clock
 Humufr> t3 = clock() import load_2 Y=load_2.load('data') x=Y[:,0]
 Humufr> y=Y[:,1] t4 = clock() #print t4-t3 #print x,y
 Humufr> col = [0,6] t1 = clock() import load_matplotlib
 Humufr> X=load_matplotlib.load('data') #X = [X[:,i] for i in col]
 Humufr> x=X[:,0] y=X[:,1] t2 = clock() print 'load matplotlib',
 Humufr> t2-t1 #print X
 Humufr> t3 = clock() import load_2
 Humufr> X=load_2.load('data',columns=range(14)) x=Y[:,0] y=Y[:,1]
 Humufr> t4 = clock() print 'load with columns choice', t4-t3
 Humufr> t3 = clock() import load_2 Y=load_2.load('data') x=Y[:,0]
 Humufr> y=Y[:,1] t4 = clock() normal = t4-t3 print 'normal load ',
 Humufr> normal
 Humufr> time = [] for i in range(16): t3 = clock() import load_2
 Humufr> X=load_2.load('data',columns=range(i)) x=Y[:,0] y=Y[:,1]
 Humufr> t4 = clock() #print 'load with columns choice', t4-t3
 Humufr> time.append(t4-t3)
 Humufr> from pylab import * time = array(time)/normal
 Humufr> plot(range(16),time) xlabel('N columns (total = 16)')
 Humufr> ylabel('time columns /normal time') show()
 Humufr> ------------------------------------------------------------------
 Humufr> def load(fname,comments='%',columns=None): """ Load ASCII
 Humufr> data from fname into an array and return the array.
 Humufr> The data must be regular, same number of values in
 Humufr> every row
 Humufr> fname can be a filename or a file handle.
 Humufr> A character for to delimit the comments can be use
 Humufr> (optional),
 Humufr> the default is the matlab character '%'.
 Humufr> An second optional argument can be add, to tell
 Humufr> which columns you
 Humufr> want use in the file. This arguments is a list who
 Humufr> contains the
 Humufr> number of columns beggining by 0 (python style).
 Humufr> matfile data is not currently supported, but see
 Humufr> Nigel Wade's matfile
 Humufr> ftp://ion.le.ac.uk/matfile/matfile.tar.gz
 Humufr> Example usage:
 Humufr> X = load('test.dat') # data in two columns t =
 Humufr> X[:,0] y = X[:,1]
 Humufr> Alternatively, you can do
 Humufr> t,y = transpose(load('test.dat')) # for two column
 Humufr> data X = load('test.dat',[0,2]) # data in two columns
 Humufr> (columns 1 and 3 use in the file)
 Humufr> X = load('test.dat') # a matrix of data X =
 Humufr> load('test.dat',columns=[2,3]) # a matrix of data, only
 Humufr> columns 3 and 4 will be use x = load('test.dat') # a
 Humufr> single column of data
 Humufr> x = load('test.dat,'#') # the character use like a
 Humufr> comment delimiter is '#' """
 Humufr> # from numarray import array
 Humufr> fh = file(fname)
 Humufr> X = [] numCols = None if columns is None: for line in
 Humufr> fh: line = line[:line.find(comments)].strip() if not
 Humufr> len(line): continue row = [float(val) for val in
 Humufr> line.split()] thisLen = len(row) if numCols is not None
 Humufr> and thisLen != numCols: raise ValueError('All rows must
 Humufr> have the same number of columns') X.append(row) else: for
 Humufr> line in fh: line = line[:line.find(comments)].strip() if
 Humufr> not len(line): continue row = [val for val in
 Humufr> line.split()] row = [float(row[i]) for i in columns]
 Humufr> thisLen = len(row) if numCols is not None and thisLen !=
 Humufr> numCols: raise ValueError('All rows must have the same
 Humufr> number of columns') X.append(row)
 Humufr> X = array(X) r,c = X.shape if r==1 or c==1: X.shape =
 Humufr> max([r,c]), return X
 
From: John H. <jdh...@ac...> - 2005年02月13日 01:51:33
>>>>> "Fl=E1vio" =3D=3D Fl=E1vio Code=E7o Coelho <fcc...@fi...> wr=
ites:
 Fl=E1vio> hi, how can I remove a colorbar?
 Fl=E1vio> in the following code, i generate figures that are saved
 Fl=E1vio> not shown. and with every new figure I get an extra
 Fl=E1vio> colorbar instead of an updated one!
Hi Flavio,
Try clearing the figure between saves with clf. Or else manage the
different figures the "figure" and "close" commands.
The default mode of matplotlib is to continue adding stuff to the same
figure, so you need to clear axes with "cla", clear figures with
"clf", close figures with "close", create new figures with "figure",
and manage the hold state with "hold", "ion", "ioff" and "ishold".
See the documentation for all of these commands at
http://matplotlib.sf.net/matplotlib.pylab.html
Hope this helps,
JDH
From: Mark H. <mh...@cl...> - 2005年02月12日 20:36:36
Hi
In case anyone has the same problem getting GTKAgg (I think this is the =
best option for use with pythonwin & Idle & pycrust since the default =
TKAgg causes GPF) to work on win XP, note that the current version of =
pyGTK for windows - pygtk-2.4.1-2.win32-py2.4.exe doesn't work with the =
versions of GTK available from the page linked to in the matplotlib faq =
owing to an unresolved dll reference. However, gtk-win32-2.6.1-rc3.exe =
will work. I think that GTK has some parallel development strands, which =
is confusing ...
Mark
p.s. matplotlib is way cool now I've got it working! All I need now is =
something equally good for doing surface plots, have tried DISLIN but =
the output doesn't look that good particularly the fonts... 
From: Robert L. <ro...@le...> - 2005年02月12日 00:15:49
John Hunter wrote:
> 
> Robert> Is this the correct approach?
> 
> Yep, that's it -- this is also discussed here
> http://matplotlib.sf.net/faq.html#TEXTOVERLAP , which also gives
> an alternative suggestion.
(Ahhh - a small light bulb is lit!)
Ok, I'd seen that but wasn't able to get it to work but now I understand why - 
when I tried it I'd not made the connection between axes and sub-plots.
> For pure OO w/o the pylab interface at
> all, there is a new example in CVS which I'll put here
Thanks, I'll check it out.
> [Snip some good advice]
> 
> I always encourage new users starting on the path to matplotlib OO API
> enlightenment to make notes and write a tutorial as you go. It would
> be a useful addition to the documentation.
No promises - so much to do, so little time :-(
I've got to code up the generation of more than 80 different graphs, resulting 
in over 32k individual instances, which is why I'm looking at matplotlib in 
preference to gnuplot, hopefully there's less trial and error involved in 
getting each graph 'just so'.
A Wiki might make the tutorial/documentation more achievable/accessible, is 
there one available?
Robert
From: Ted D. <ted...@jp...> - 2005年02月11日 21:46:33
Thanks for all the advice! We're going to start working on this ground 
track plotting package in the March-April time frame so I'm going to save 
off these notes for the implementor. We'll let you know if we need any 
more help then.
Thanks,
Ted
At 01:25 PM 2/11/2005, John Hunter wrote:
> >>>>> "Ted" == Ted Drain <ted...@jp...> writes:
> Ted> For example, if I have a data set that looks like this:
>
> Ted> [155,2] [165,4] [175,6] [-175,8] [-165,10] [-155,12]
>
> Ted> I really need this data to be drawn as two separate lines:
> Ted> [155,2] [165,4] [175,6] [180,7]
>
> Ted> and [-180,7] [-175,8] [-165,10] [-155,12]
>
> Ted> Ideally these two segments should be treated as a single line
> Ted> wherever applicable (legend, style, etc).
>
>Got it -- what comes immediately to mind is for you to create a new
>class derived from Line2D, that contains your 2...N lines as private
>attrs, defines __getattr__ to return the attr of line[0], and calls
>the Line2D parent setattr on each of your contained line instances.
>You can then add this line to the Axes with add_line.
>
>You would have to be a little clever with the get_xdata and get_ydata
>attrs, which are used for autoscaling. If this looks like a good way
>to go, I can help you with it if you want - it could be tricky to get
>just right.
>
>The other possibility would be to setup an observer pattern on the
>line0 properties, such that any changes would be fired off to the
>observers. This is an area where it would be nice to have enthought
>traits built-in, since all trains support observers. As you may have
>noticed on the dev list, this is an area of active discussion.
>
>
> Ted> I'd probably label this as a "mostly acceptable work-around"
> Ted> since it requires generating two data arrays. In my case,
> Ted> the data is expensive to compute so we'd probably have to
> Ted> generate a second array by selectively copying points from
> Ted> the first array which is kind of annoying. I was hoping for
> Ted> a keyword that said how often to generate the markers for an
> Ted> existing line (with the default as one of course). Probably
> Ted> not a huge deal though.
>
>If this becomes a performance problem for you, another idea would be
>to use a marker mask. Eg add an additional property to the line class
>which are the indices at which to write markers.
>
>Currently the line class is hairy in CVS, mainly because it is
>supporting the old and newstyle backend drawing interfaces. The
>newstyle interface has only two renderer methods that it calls
>(draw_lines and draw_markers). It would be fairly easy to subclass
>Line2D to support a marker mask, possibly passing it on as a kwarg to
>the renderer.draw_markers method. One could do it in Numeric a the
>python level; if you are looking for optimal performance, it would be
>barely more than a no-op at the backend level.
>
>
>JDH
>
>
>-------------------------------------------------------
>SF email is sponsored by - The IT Product Guide
>Read honest & candid reviews on hundreds of IT Products from real users.
>Discover which products truly live up to the hype. Start reading now.
>http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
>_______________________________________________
>Matplotlib-users mailing list
>Mat...@li...
>https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Ted Drain Jet Propulsion Laboratory ted...@jp... 
From: John H. <jdh...@ac...> - 2005年02月11日 21:36:38
>>>>> "Ted" == Ted Drain <ted...@jp...> writes:
 Ted> For example, if I have a data set that looks like this:
 Ted> [155,2] [165,4] [175,6] [-175,8] [-165,10] [-155,12]
 Ted> I really need this data to be drawn as two separate lines:
 Ted> [155,2] [165,4] [175,6] [180,7]
 Ted> and [-180,7] [-175,8] [-165,10] [-155,12]
 Ted> Ideally these two segments should be treated as a single line
 Ted> wherever applicable (legend, style, etc).
Got it -- what comes immediately to mind is for you to create a new
class derived from Line2D, that contains your 2...N lines as private
attrs, defines __getattr__ to return the attr of line[0], and calls
the Line2D parent setattr on each of your contained line instances.
You can then add this line to the Axes with add_line.
You would have to be a little clever with the get_xdata and get_ydata
attrs, which are used for autoscaling. If this looks like a good way
to go, I can help you with it if you want - it could be tricky to get
just right.
The other possibility would be to setup an observer pattern on the
line0 properties, such that any changes would be fired off to the
observers. This is an area where it would be nice to have enthought
traits built-in, since all trains support observers. As you may have
noticed on the dev list, this is an area of active discussion.
 Ted> I'd probably label this as a "mostly acceptable work-around"
 Ted> since it requires generating two data arrays. In my case,
 Ted> the data is expensive to compute so we'd probably have to
 Ted> generate a second array by selectively copying points from
 Ted> the first array which is kind of annoying. I was hoping for
 Ted> a keyword that said how often to generate the markers for an
 Ted> existing line (with the default as one of course). Probably
 Ted> not a huge deal though.
If this becomes a performance problem for you, another idea would be
to use a marker mask. Eg add an additional property to the line class
which are the indices at which to write markers. 
Currently the line class is hairy in CVS, mainly because it is
supporting the old and newstyle backend drawing interfaces. The
newstyle interface has only two renderer methods that it calls
(draw_lines and draw_markers). It would be fairly easy to subclass
Line2D to support a marker mask, possibly passing it on as a kwarg to
the renderer.draw_markers method. One could do it in Numeric a the
python level; if you are looking for optimal performance, it would be
barely more than a no-op at the backend level.
JDH
From: Ted D. <ted...@jp...> - 2005年02月11日 21:25:07
Inlined comments below...
At 12:41 PM 2/11/2005, John Hunter wrote:
> >>>>> "Ted" == Ted Drain <ted...@jp...> writes:
>
> Ted> Is there an easy way to plot multiple collections of points
> Ted> connected by a line and have only a single legend entry show
> Ted> up? It would also be nice if any modifications to that entry
> Ted> (marker, color, etc) would affect all the line segments.
>
>Not 100% sure what you are after here. You can control which lines
>and patches get passed to the legend by explicitly passing them (as
>opposed to using the autolegend capabilities). Eg
>
> ax.legend((l1, p1), ('A line, 'A patch')
>
>Also, have you looked into the LineCollection class -- this sounds
>like it would support some of what you are describing. Perhaps if you
>explain a bit more.
What's happening here is that we have a plot that's a map of the earth 
going from -180 to 180 longitude and pole to pole. A spacecraft ground 
trajectory goes around and around so when it hit's the +180 longitude, it 
needs to wrap around to -180. We want this to be a line plot. If you just 
put in the x,y coordinates as a line plot, you get a long line segment when 
it goes from say:
(175,20) -> (-175,30)
What we've done in the past is to use a heuristic to detect this case. For 
example, I might say if the delta x is greater than 90% of the total 
longitude, it's a wrap around case. In that case, I do linear 
interpolation to get a point at the edge of the map (in this case 180, 25), 
insert this point, and split the line into two pieces at this point.
For example, if I have a data set that looks like this:
[155,2]
[165,4]
[175,6]
[-175,8]
[-165,10]
[-155,12]
I really need this data to be drawn as two separate lines:
[155,2]
[165,4]
[175,6]
[180,7]
and
[-180,7]
[-175,8]
[-165,10]
[-155,12]
Ideally these two segments should be treated as a single line wherever 
applicable (legend, style, etc).
> Ted> Ted PS: we also need some way to draw only the n'th marker in
> Ted> a line plot. We plot a lot of trajectories where time is
> Ted> progressing along the line so it's useful to generate the
> Ted> plot using 1 minute data (for example) and then have a marker
> Ted> be displayed every 60'th point.
>
>Look at subplot(211) in examples/subplot_demo.py. There a line is
>plotted with one temporal resolution, and markers are placed along the
>line at subsampled points. Basically two lines are added with
>different sampling frequencies.
>
>Does this suffice?
I'd probably label this as a "mostly acceptable work-around" since it 
requires generating two data arrays. In my case, the data is expensive to 
compute so we'd probably have to generate a second array by selectively 
copying points from the first array which is kind of annoying. I was 
hoping for a keyword that said how often to generate the markers for an 
existing line (with the default as one of course). Probably not a huge 
deal though.
>JDH
Ted Drain Jet Propulsion Laboratory ted...@jp... 

Showing results of 267

<< < 1 .. 4 5 6 7 8 .. 11 > >> (Page 6 of 11)
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 によって変換されたページ (->オリジナル) /