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 14 results of 14

From: Robert L. <ro...@le...> - 2005年02月14日 23:58:20
John Hunter wrote:
> 
> figure(frameon=False)
> 
> must work for the figure frame. 
Sorry, finger/brain trouble at this end - it works perfectly.
Robert
From: John H. <jdh...@ac...> - 2005年02月14日 23:42:15
>>>>> "Robert" == Robert Leftwich <ro...@le...> writes:
 Robert> I'd like to be able to generate a png with a transparent
 Robert> background so that I can overly multiple graphs on top of
 Robert> each other (in a web page). I've tried the frameOn-False
 Robert> discussed a couple of times in the mailing list it doesn't
 Robert> produce the desired result. Is this possible?
figure(frameon=False)
must work for the figure frame. Do you need the axes to be
transparent too. Note that the figure and axes frames are both
matplotlib rectangles. You can control the transparency of the
rectangle by calling
rect.set_alpha(0.5)
You can access the figure Rectangle instance as
 fig.figPatch
and the Axes Rectangle instance as 
 ax.axesPatch 
Passing one of these instances to "help" or "set" will give more info.
JDH
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

Showing 14 results of 14

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