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

Showing 13 results of 13

From: John H. <jd...@gm...> - 2007年08月22日 20:27:03
On 8/22/07, Angus McMorland <am...@gm...> wrote:
> > I would like to use mpl_connect and disconnect to examine a series of 2d
> > arrays in turn (with a "for" loop), one after the other:
> >
> > ==> at each iteration I'd like to be able to use the left mouse button
> > to evaluate the sum of all x,y coordinates I select by (right) clicking
> > somewhere in the present array, and then switch to the next 2d data
> > array after I hit the right mouse button (button==3). I have no clue how
> > to do this and the program I wrote so far is just hanging there and does
> > nothing. Didn't see anything like this in the archive.
> >
> > Any way to get out of this? Thanks for your help.
>
> As a general rule of thumb, if you're using a loop like while
> newoffset.stay: pass, then you're doing something wrong.
Angus is right w/ resepct to mpl -- we don't have any support for
blocking calls. This is a very frequent request and you are certainly
right Eric to *expect* something like this to work, but in the context
of multiple GUIs w/ threads it is not too easy. One could probably
make tkagg work with only minor modifications to mpl, but the other
GUIs would be harder becasue they are threaded. So using event
handling and callbacks are the way to solve this problem, as Angus
suggests in his solution, but they are harder for people to get their
head around than blocking calls, so hopefully we will get support for
this idiom before the end of time.
JDH
From: Angus M. <am...@gm...> - 2007年08月22日 19:41:19
Hi Eric,
On 23/08/07, Eric Emsellem <ems...@ob...> wrote:
> Hi
>
> sorry to post this again but all my attempts to solve the matplotlib
> problem below failed and I desperately need this to progress.
>
> I would like to use mpl_connect and disconnect to examine a series of 2d
> arrays in turn (with a "for" loop), one after the other:
>
> ==> at each iteration I'd like to be able to use the left mouse button
> to evaluate the sum of all x,y coordinates I select by (right) clicking
> somewhere in the present array, and then switch to the next 2d data
> array after I hit the right mouse button (button==3). I have no clue how
> to do this and the program I wrote so far is just hanging there and does
> nothing. Didn't see anything like this in the archive.
>
> Any way to get out of this? Thanks for your help.
As a general rule of thumb, if you're using a loop like while
newoffset.stay: pass, then you're doing something wrong. This will
take control of all execution and let nothing else happen. You have to
do the control by switching between functions. Here's a modification
to your code that I think does what you want:
import numpy as n
import pylab as p
class offset:
 def __init__(self, parent) :
 self.parent = parent
 self.xc = 0.
 self.yc = 0.
 self.stay = 1
 def on_click(self, event) :
 if event.button == 1:
 if event.inaxes is not None:
 print "Adding point %d, %d" % (event.xdata, event.ydata)
 self.xc += event.xdata
 self.yc += event.ydata
 elif event.button == 3:
 print "Switching data"
 self.parent.show_next()
class displayer:
 def __init__(self):
 self.i = 0
 self.alldata = [n.random.rand(10,10) for x in xrange(3)]
 self.newoffset = offset(self)
 self.binding = p.connect('button_press_event', self.newoffset.on_click)
 self.show_next()
 def show_next(self):
 if self.i < len(self.alldata):
 p.imshow(self.alldata[self.i])
 self.i += 1
 else:
 p.disconnect(self.binding)
 print self.newoffset.xc, self.newoffset.yc
I hope that helps you see the concept.
Angus.
-- 
AJC McMorland, PhD Student
Physiology, University of Auckland
From: Greg W. <gre...@gm...> - 2007年08月22日 18:10:32
Hi Chris,
Sorry to bring it up. I know you didn't make the decision so I'll shut up
about it right after I say the following:
"That was a really dumb/weak reason for breaking the standard 'discussion
list' format"
What a pain.
Greg
On 8/22/07, Christopher Barker <Chr...@no...> wrote:
>
> Greg Willden wrote:
> > It seems that the list configuration is somewhat broken.
> > The reply-to header is not set in some emails sent to the list.
> > This means that replies go directly to the requestors but not to the
> > list as a whole.
> >
> > That seems pretty broken to me.
>
> me too, but there are folks that are convinced that this is the way to
> have things set up. There was a pretty extensive discussion about it on
> this list a year or so ago (but it may have been another list I'm on).
> The discussion included a link to someones very well written BLOG entry
> on why mailing lists should be set up without the reply-to header sent.
> It was very well written and argued, but frankly, I think, based on
> false assumptions.
>
> It comes down to this:
>
> Which is worse (pro-rated by how likely it is)?
>
> Accidentally sending what was intended as a private note to the list.
>
> or
>
> Accidentally sending what was meant as a list note to only the OP and
> often ending up with many copies of the same message, as reply-to all
> keeps adding each contributor to the thread.
>
> Note that with the current system, you have to hit "reply-to-all", which
> ends up sending duplicate copies to the OP (and anyone else that has
> added to the thread) unless you make a point of deleting the extra
> receiver. I try to do that, but it is a pain.
>
> However, this has been argued out, and a decision made, so I probably
> shouldn't have written this. Sorry.
>
> -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...
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems? Stop.
> Now Search log events and configuration files using AJAX and a browser.
> Download your FREE copy of Splunk now >> http://get.splunk.com/
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
-- 
Linux. Because rebooting is for adding hardware.
From: Christopher B. <Chr...@no...> - 2007年08月22日 17:02:23
Greg Willden wrote:
> It seems that the list configuration is somewhat broken.
> The reply-to header is not set in some emails sent to the list.
> This means that replies go directly to the requestors but not to the 
> list as a whole.
> 
> That seems pretty broken to me.
me too, but there are folks that are convinced that this is the way to 
have things set up. There was a pretty extensive discussion about it on 
this list a year or so ago (but it may have been another list I'm on). 
The discussion included a link to someones very well written BLOG entry 
on why mailing lists should be set up without the reply-to header sent. 
It was very well written and argued, but frankly, I think, based on 
false assumptions.
It comes down to this:
Which is worse (pro-rated by how likely it is)?
Accidentally sending what was intended as a private note to the list.
or
Accidentally sending what was meant as a list note to only the OP and 
often ending up with many copies of the same message, as reply-to all 
keeps adding each contributor to the thread.
Note that with the current system, you have to hit "reply-to-all", which 
ends up sending duplicate copies to the OP (and anyone else that has 
added to the thread) unless you make a point of deleting the extra 
receiver. I try to do that, but it is a pain.
However, this has been argued out, and a decision made, so I probably 
shouldn't have written this. Sorry.
-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: Jeff W. <js...@fa...> - 2007年08月22日 14:53:02
Sebastian Krieger wrote:
> Hi,
>
> Does anyone eventually have a sample on how to make Hovmoller plots 
> using matplotlib? Specially with good looking time axis like Ferret does?
>
> Thanks
> Sebastian
>
>
> 
Sebastian: Don't have a hovmoller example handy, but you can see how to 
make a nice time axis by looking at date_demo.py at 
http://matplotlib.sourceforge.net/screenshots.html. Just replace the 
line plot with a contour plot, and there you go.
-Jeff
-- 
Jeffrey S. Whitaker Phone : (303)497-6313
Meteorologist FAX : (303)497-6449
NOAA/OAR/PSD R/PSD1 Email : Jef...@no...
325 Broadway Office : Skaggs Research Cntr 1D-124
Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg
From: Greg W. <gre...@gm...> - 2007年08月22日 14:49:44
It seems that the list configuration is somewhat broken.
The reply-to header is not set in some emails sent to the list.
This means that replies go directly to the requestors but not to the list as
a whole.
That seems pretty broken to me.
Any list admin out there want to comment.
(by replying to mat...@li... of course)
Greg
-- 
"Java: The COBOL of the 90's" -Paul Rubin on comp.lang.python
From: Sebastian K. <seb...@io...> - 2007年08月22日 14:37:17
Hi,
Does anyone eventually have a sample on how to make Hovmoller plots 
using matplotlib? Specially with good looking time axis like Ferret does?
Thanks
Sebastian
From: Eric E. <ems...@ob...> - 2007年08月22日 13:33:17
Hi
sorry to post this again but all my attempts to solve the matplotlib
problem below failed and I desperately need this to progress.
I would like to use mpl_connect and disconnect to examine a series of 2d
arrays in turn (with a "for" loop), one after the other:
==> at each iteration I'd like to be able to use the left mouse button
to evaluate the sum of all x,y coordinates I select by (right) clicking
somewhere in the present array, and then switch to the next 2d data
array after I hit the right mouse button (button==3). I have no clue how
to do this and the program I wrote so far is just hanging there and does
nothing. Didn't see anything like this in the archive.
Any way to get out of this? Thanks for your help.
Eric
#=================
# stupid simple code just to illustrate the kind of things I would like to achieve
# This does not work and just hang there...
#=================
import numpy as num
class offset:
 def __init__(self) :
 self.xc = 0.
 self.yc = 0.
 self.stay = 1
 def on_click(self, event) :
 if event.button == 1:
 if event.inaxes is not None:
 self.xc += event.xdata
 self.yc += event.ydata
 elif event.button == 3:
 self.stay = 0
data1 = num.random.rand(10,10)
data2 = num.random.rand(10,10)
data3 = num.random.rand(10,10)
alldata = [data1, data2, data3]
for i in range(len(alldata)) :
 imshow(alldata[i])
 newoffset = offset()
 binding = connect('button_press_event', newoffset.on_click)
 while newoffset.stay :
 pass
 disconnect(binding)
 print newoffset.xc, newoffset.yc
From: Wolfgang K. <wke...@go...> - 2007年08月22日 09:50:32
I am sorry, here the better explanation:
I have a scirpt to reduce data. from time to time it should bring up an 
interactive matplotlib figure and then when I close the window it should 
continue.it is important for me that the script actually stops when 
opening the window.
The problem is (which I found out just now) I am running this in ipython 
and if I close the window the gtk.mainloop() stays active and doesnt let 
me continue my script. So i'm looking for a fucntion I can call to stop 
the backend thread. I know there is a thread called gtk.gdk.thread_leave 
but I need the appropriate TK object which is the window(or 
matplotlib_object or whatever) to call this function. I am happy to use 
another backend but I am fairly new to tk and gtk in python so I didnt 
see anything else.
thanks in advance
 Wolfgang
John Hunter wrote:
> On 8/22/07, Wolfgang Kerzendorf <wke...@go...> wrote:
> 
>> Is there any way I can stop the mainloop of the gtkagg backend. i know
>> there is a threads_leave thing but I neec the Tk object from matplotlib.
>> The problem is that my script doesnt continue after the window has been
>> closed
>> 
>
> I am not exactly sure what you are after ... Do you need to use
> GTKAgg at all, or can you simply set your backend to TkAgg in your
> matplotlibrc and leave it at that. If for some reason you need
> GTKAgg, and then need to switch to TkAgg, it may be possible to do
> this with the "switch_backend" function in pylab. I have done this on
> occasion with success, but it is mostly experimental. Perhaps if you
> explain your use case a little better we can advise more.
>
> 
From: John H. <jd...@gm...> - 2007年08月22日 09:39:11
On 8/22/07, Wolfgang Kerzendorf <wke...@go...> wrote:
> Is there any way I can stop the mainloop of the gtkagg backend. i know
> there is a threads_leave thing but I neec the Tk object from matplotlib.
> The problem is that my script doesnt continue after the window has been
> closed
I am not exactly sure what you are after ... Do you need to use
GTKAgg at all, or can you simply set your backend to TkAgg in your
matplotlibrc and leave it at that. If for some reason you need
GTKAgg, and then need to switch to TkAgg, it may be possible to do
this with the "switch_backend" function in pylab. I have done this on
occasion with success, but it is mostly experimental. Perhaps if you
explain your use case a little better we can advise more.
From: Wolfgang K. <wke...@go...> - 2007年08月22日 09:17:08
Is there any way I can stop the mainloop of the gtkagg backend. i know 
there is a threads_leave thing but I neec the Tk object from matplotlib.
The problem is that my script doesnt continue after the window has been 
closed
thanks in advance
 Wolfgang
Andrew Jaffe <a.h...@gm...> writes:
> I admit I don't understand the problems or the speccific code involved, 
> but I *think* it may be that the OSX-specific code isn't restricted to 
> afm files. Hence I wonder if the following is a fix:
> - for f in OSXInstalledFonts():
> + for f in OSXInstalledFonts(fontext=fontext):
It helps in this particular case, but I think the intention behind this
code is to allow loading non-TrueType fonts even when fontext='ttf'. On
OS X there are various non-TrueType font formats (dfont, otf,
resource-fork fonts), at least some of which are supported by freetype,
so if you always pass fontext to OSXInstalledFonts, you unnecessarily
limit the fonts found to those whose filename indicates ttf format.
(Macs also don't care as much about filename extensions as the rest of
the world.)
But I'm just guessing here as to the reasoning behind the code. Somebody
else might know better?
-- 
Jouni K. Seppänen
http://www.iki.fi/jks
From: Wolfgang K. <wke...@go...> - 2007年08月22日 01:25:17
The script I am writing gets sometimes stuck after show(). Of course 
show() halts the script but when I close the window I want it to 
continue. Is there a sure way to kill off the pylab thread and continue 
like with a key press event on ESC and then calling a stop routine of 
the thread.
Thanks in advance
 Wolfgang

Showing 13 results of 13

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