SourceForge logo
SourceForge logo
Menu

matplotlib-users — Discussion related to using matplotlib

You can subscribe to this list here.

2003 Jan
Feb
Mar
Apr
May
(3)
Jun
Jul
Aug
(12)
Sep
(12)
Oct
(56)
Nov
(65)
Dec
(37)
2004 Jan
(59)
Feb
(78)
Mar
(153)
Apr
(205)
May
(184)
Jun
(123)
Jul
(171)
Aug
(156)
Sep
(190)
Oct
(120)
Nov
(154)
Dec
(223)
2005 Jan
(184)
Feb
(267)
Mar
(214)
Apr
(286)
May
(320)
Jun
(299)
Jul
(348)
Aug
(283)
Sep
(355)
Oct
(293)
Nov
(232)
Dec
(203)
2006 Jan
(352)
Feb
(358)
Mar
(403)
Apr
(313)
May
(165)
Jun
(281)
Jul
(316)
Aug
(228)
Sep
(279)
Oct
(243)
Nov
(315)
Dec
(345)
2007 Jan
(260)
Feb
(323)
Mar
(340)
Apr
(319)
May
(290)
Jun
(296)
Jul
(221)
Aug
(292)
Sep
(242)
Oct
(248)
Nov
(242)
Dec
(332)
2008 Jan
(312)
Feb
(359)
Mar
(454)
Apr
(287)
May
(340)
Jun
(450)
Jul
(403)
Aug
(324)
Sep
(349)
Oct
(385)
Nov
(363)
Dec
(437)
2009 Jan
(500)
Feb
(301)
Mar
(409)
Apr
(486)
May
(545)
Jun
(391)
Jul
(518)
Aug
(497)
Sep
(492)
Oct
(429)
Nov
(357)
Dec
(310)
2010 Jan
(371)
Feb
(657)
Mar
(519)
Apr
(432)
May
(312)
Jun
(416)
Jul
(477)
Aug
(386)
Sep
(419)
Oct
(435)
Nov
(320)
Dec
(202)
2011 Jan
(321)
Feb
(413)
Mar
(299)
Apr
(215)
May
(284)
Jun
(203)
Jul
(207)
Aug
(314)
Sep
(321)
Oct
(259)
Nov
(347)
Dec
(209)
2012 Jan
(322)
Feb
(414)
Mar
(377)
Apr
(179)
May
(173)
Jun
(234)
Jul
(295)
Aug
(239)
Sep
(276)
Oct
(355)
Nov
(144)
Dec
(108)
2013 Jan
(170)
Feb
(89)
Mar
(204)
Apr
(133)
May
(142)
Jun
(89)
Jul
(160)
Aug
(180)
Sep
(69)
Oct
(136)
Nov
(83)
Dec
(32)
2014 Jan
(71)
Feb
(90)
Mar
(161)
Apr
(117)
May
(78)
Jun
(94)
Jul
(60)
Aug
(83)
Sep
(102)
Oct
(132)
Nov
(154)
Dec
(96)
2015 Jan
(45)
Feb
(138)
Mar
(176)
Apr
(132)
May
(119)
Jun
(124)
Jul
(77)
Aug
(31)
Sep
(34)
Oct
(22)
Nov
(23)
Dec
(9)
2016 Jan
(26)
Feb
(17)
Mar
(10)
Apr
(8)
May
(4)
Jun
(8)
Jul
(6)
Aug
(5)
Sep
(9)
Oct
(4)
Nov
Dec
2017 Jan
(5)
Feb
(7)
Mar
(1)
Apr
(5)
May
Jun
(3)
Jul
(6)
Aug
(1)
Sep
Oct
(2)
Nov
(1)
Dec
2018 Jan
Feb
Mar
Apr
(1)
May
Jun
Jul
Aug
Sep
Oct
Nov
Dec
2020 Jan
Feb
Mar
Apr
May
(1)
Jun
Jul
Aug
Sep
Oct
Nov
Dec
2025 Jan
(1)
Feb
Mar
Apr
May
Jun
Jul
Aug
Sep
Oct
Nov
Dec
S M T W T F S




1
(13)
2
(11)
3
(2)
4
(4)
5
(28)
6
(17)
7
(28)
8
(6)
9
(6)
10
11
12
(9)
13
(13)
14
(21)
15
(16)
16
(6)
17
(3)
18
(3)
19
(8)
20
(15)
21
(33)
22
(10)
23
(17)
24
(2)
25
(5)
26
(23)
27
(18)
28
(6)



Showing 6 results of 6

"John Hunter" <jd...@gm...> writes:
>> But this fails to plot the first rectange in the resulting plot. The
>> second, red rectangle is painted correctly in the resulting plot, but
>> the first one is totaly missing in the plot, leaving only a line in
>> the plot. Is there some kind of internal status that has to be
>> resettet in the actors?
>
> When you add an artist to the Axes, it checks to see if you have set a
> transformation. If you haven't, it will set the default axes
> transformation. If you have, it leaves the transformation unchanged.
> This is why you are seeing the problems you see.
>
> Before adding them to the second axes, you need to reset the
> transformation for each line, text, etc....
>
>
> for artist in ax.get_child_artists():
> artist.set_transform(ax2.transData)
> if isinstance(artist, Line2D):
> ax2.add_line(artist)
> elif ....
>
> should work....
It does. It helps me a lot, thank you.
Regards
Berthold
--=20
ber...@xn... / <http://h=C3=B6llmanns.de/>
bh...@we... / <http://starship.python.net/crew/bhoel/>
From: Matthew B. <mat...@gm...> - 2007年02月08日 17:01:13
Hi,
> > I want to import binary files generated from C/FORTRAN into matplotlib for
> > plotting.
> > Can this be done using 'load'?
>
> If you are using SciPy, scipy.io has a few functions which may
> help. scipy.io.fromfile, for example.
Ah - just to be clear, for scipy 0.5.2, scipy.io.fromfile is in fact
numpy.fromfile - that was just a goofy import error on my part when
writing the matlab file loading routines. For clarity, I think it is
best to pull this from the scipy.io namespace for the next release, so
please use numpy.fromfile for this.
Best,
Matthew
From: Nils W. <nw...@ia...> - 2007年02月08日 16:28:18
Attachments: asa.png
Hi all,
Is there a way to add the coordinates in text form to each plus in the
attached figure ?
ERach plus in the plot is generated by
plot([data[-1].real],[data[-1].imag],'k+')
For example the rightmost plus (in the upper right half plane) should
have a text (1.049+0.692j)
Can I use text for this purpose ?
 
Any pointer would be appreciated.
Thanks in advance
 Nils
From: Mark B. <ma...@gm...> - 2007年02月08日 09:07:45
Does anybody understand why CXX extensions don't pickle?
I have the same problem with my own CXX extensions, which I make with SWIG.
On the other hand, FORTRAN extensions using f2py pickle fine!
Mark
From: "John Hunter" <jd...@gm...>
> Subject: Re: [Matplotlib-users] Native file format
> To: "Edin Salkovic" <edi...@gm...>
> Cc: Jan Strube <cur...@gm...>,
> mat...@li..., Eric Firing
> <ef...@ha...>
> Message-ID:
> <88e...@ma...>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> On 2/7/07, Edin Salkovic <edi...@gm...> wrote:
>
> > Why can't mpl's figures be pickled?
>
> The main thing is we need to add pickle support for all of mpl's extension
> code
>
> http://docs.python.org/lib/node321.html
>
> In earlier attempts people got stuck with trying to pickle the
> CXX extension code, which was causing some problems, but these
> problems may be fixed in more recent versions of CXX. Todd Miller was
> the last person to look at this in some detail, I think.
>
> Other hinderances may come from the GUI layer, since figures store
> pointers to their canvases which in some cases come from GUI extension
> code that may not support pickling. But we can fairly easy decouple
> the figure from the canvas at pickle time and deal with pure mpl,
> numpy and python objects. The main work is to add pickle
> serialization to the mpl extension code.
>
From: Eric F. <ef...@ha...> - 2007年02月08日 07:43:46
Angus McMorland wrote:
> Hi all,
> 
> Did any progress get made beyond this discussion below? I'm trying to
> get contourf3D working, using latest svn, and it still seems to be
> out-of-order. Contour3D works, but I get exactly the same errors (and
> went exactly the same route trying to fix them) as Matthew.
> 
> On 13/01/07, Eric Firing <ef...@ha...> wrote:
>> I don't know if everything 3D works, but the first error you note below
> 
> Which one is supposed to be the 'first' error mentioned here? In my
> latest svn checkout, the line:
> 
> levels, colls = self.contourf(X, Y, Z, 20)
> 
> still appears to be present.
> 
>> is fixed in svn, and I suspect in 0.87.7, the last release. 0.87.5 is
>> rather old--quite a bit has changed between minor releases.
Aha! What is fixed is the corresponding error in contour3D--but 
strangely, the same error in contourf3D was never fixed. I took a stab 
at it just now but failed--there is more wrong with it than this simple 
error--so I made it raise NotImplementedError. I don't know whether 
contourf3D ever *did* work. Nor am I sure exactly what it should do if 
it worked. The problem is that no one has taken on the maintenance of 
the 3D plotting.
Eric
From: Angus M. <am...@gm...> - 2007年02月08日 03:28:35
Hi all,
Did any progress get made beyond this discussion below? I'm trying to
get contourf3D working, using latest svn, and it still seems to be
out-of-order. Contour3D works, but I get exactly the same errors (and
went exactly the same route trying to fix them) as Matthew.
On 13/01/07, Eric Firing <ef...@ha...> wrote:
> I don't know if everything 3D works, but the first error you note below
Which one is supposed to be the 'first' error mentioned here? In my
latest svn checkout, the line:
levels, colls = self.contourf(X, Y, Z, 20)
still appears to be present.
> is fixed in svn, and I suspect in 0.87.7, the last release. 0.87.5 is
> rather old--quite a bit has changed between minor releases.
>
> Eric
>
> Matthew Koichi Grimes wrote:
> > contourf3D and contour3D seem to be broken in my copy of matplotlib
> > 0.87.5 that I installed from ubuntu edgy's repositories. Is this a known
> > problem? I started going through axes3d.py etc and fixing the reported
> > errors, but the error trail seems to go pretty deep across multiple
> > files. Now I'm wondering if maybe this is something major that has
> > already been fixed by more experienced hands in SVN or something.
> >
> > In the off chance that this is an unknown problem, I've enumerated the
> > errors below. These all happened while attempting to run the example
> > code in http://www.scipy.org/Cookbook/Matplotlib/mplot3D
> >
> > If it's fixed in SVN, I'll try installing that, but I haven't seen this
> > bug mentioned in matplotlib's bug list on sourceforge.net.
> >
> > -- Matt
> >
> > When I called contourf3D the first time, I got the following error:
> >
> > <snip>
> > File "/usr/lib/python2.4/site-packages/matplotlib/axes3d.py", line 596,
> > in contourf3D
> > levels, colls = self.contourf(X, Y, Z, 20)
> > TypeError: unpack non-sequence
> > </snip>
> >
> > As suggested in the examples page above, I went into contourf3D's
> > function definition in axes3d.py and replaced:
> >
> > levels, colls = self.contourf(X, Y, Z, 20)
> >
> > with
> >
> > C = self.contourf(X, Y, Z, *args, **kwargs)
> > levels, colls = (C.levels, C.collections)
> >
> > I then got a new error when calling contourf3D:
> >
> > <snip>
> > exceptions.NameError Traceback (most
> > recent call last)
> >
> > /home/mkg/Desktop/<ipython console>
> >
> > /usr/lib/python2.4/site-packages/matplotlib/axes3d.py in
> > contourf3D(self, X, Y, Z, *args, **kwargs)
> > 604 zs = [z1] * (len(linec._verts[0])/2)
> > 605 zs += [z2] * (len(linec._verts[0])/2)
> > --> 606 art3d.wrap_patch(linec, zs, fn=draw_polyc)
> > 607 self.auto_scale_xyz(X,Y,Z, had_data)
> > 608 return levels,colls
> >
> > NameError: global name 'draw_polyc' is not defined
> > </snip>
> >
> > After changing draw_polyc to art3d.draw_polyc, it complained that
> > art3d.wrap_patch in fact only takes two arguments. So I changed
> >
> > art3d.wrap_patch(linec, zs, fn=draw_polyc)
> >
> > to
> >
> > art3d.wrap_patch(linec, zs)
> >
> > Which led to the latest error message:
> >
> > <snip>
> > Traceback (most recent call last):
> > File
> > "/usr/lib/python2.4/site-packages/matplotlib/backends/backend_gtk.py",
> > line 284, in expose_event
> > self._render_figure(self._pixmap, w, h)
> > File
> > "/usr/lib/python2.4/site-packages/matplotlib/backends/backend_gtkagg.py",
> > line 73, in _render_figure
> > FigureCanvasAgg.draw(self)
> > File
> > "/usr/lib/python2.4/site-packages/matplotlib/backends/backend_agg.py",
> > line 391, in draw
> > self.figure.draw(renderer)
> > File "/usr/lib/python2.4/site-packages/matplotlib/figure.py", line
> > 538, in draw
> > for a in self.axes: a.draw(renderer)
> > File "/usr/lib/python2.4/site-packages/matplotlib/axes3d.py", line
> > 172, in draw
> > Axes.draw(self, renderer)
> > File "/usr/lib/python2.4/site-packages/matplotlib/axes.py", line 1057,
> > in draw
> > a.draw(renderer)
> > File "/usr/lib/python2.4/site-packages/matplotlib/art3d.py", line 56,
> > in call_draw3d
> > self.draw3d(renderer)
> > File "/usr/lib/python2.4/site-packages/matplotlib/art3d.py", line 184,
> > in draw3d
> > xs,ys = zip(*self._offsets)
> > TypeError: zip() argument after * must be a sequence
> > </snip>
> >
> > Contour3D (not contourf3D) does work in that it successfully displays a
> > plot, but when I mouseover this plot, my python console fills with the
> > following error message (one repetition for each mouse event):
> >
> > <snip>
> > /usr/lib/python2.4/site-packages/matplotlib/backends/backend_gtk.py in
> > motion_notify_event(self, widget, event)
> > 178 # flipy so y=0 is bottom of canvas
> > 179 y = self.allocation.height - y
> > --> 180 FigureCanvasBase.motion_notify_event(self, x, y)
> > 181 return False # finish event propagation?
> > 182
> >
> > /usr/lib/python2.4/site-packages/matplotlib/backend_bases.py in
> > motion_notify_event(self, x, y, guiEvent)
> > 885 event = MouseEvent('motion_notify_event', self, x, y,
> > self._button, self._key, guiEvent=guiEvent)
> > 886 for func in self.callbacks.get('motion_notify_event',
> > {}).values():
> > --> 887 func(event)
> > 888
> > 889 def draw(self, *args, **kwargs):
> >
> > /usr/lib/python2.4/site-packages/matplotlib/axes3d.py in on_move(self,
> > event)
> > 396 """
> > 397 #NOTE - this shouldn't be called before the graph has
> > been drawn for the first time!
> > --> 398 if event.inaxes != self or not self.M:
> > 399 return
> > 400 #
> >
> > ValueError: The truth value of an array with more than one element is
> > ambiguous. Use a.any() or a.all()
> > </snip>
-- 
AJC McMorland, PhD Student
Physiology, University of Auckland

Showing 6 results of 6

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