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

Showing 13 results of 13

From: Malte M. <Mal...@cs...> - 2008年05月13日 23:41:41
Hi,
The segv also occurs in matplotlib-0.90.1. A clean build doesn't help.
Here is the gdb output, looks like something is pointing into nirvana..
(gdb) p bboxo
1ドル = <value optimized out>
(gdb) p bbox
2ドル = (Bbox *) 0x7ffffffb
(gdb) p bbox->_ll
Cannot access memory at address 0x7ffffffb
Cheers,
Malte
On 13/05/2008, at 10:19 PM, Michael Droettboom wrote:
> p bboxo
> p bbox
> p bbox->_ll
From: S. N. <sor...@gm...> - 2008年05月13日 20:34:57
Hi,
I want to be able to disable the zoom tool (when it has been selected) when
I press another button on the toolbar, and disable the same button when I
click the zoom tool... anyone know how to do this??
Thanks,
Soren
From: Eric E. <ems...@ob...> - 2008年05月13日 15:58:31
Hi,
thanks for the input.
In fact this happens on a dual core machine. As for the Ipython version etc it
is written at the end of my original email.
I'll try to see with the Ipython forum maybe. Not sure where it comes from,
which is the difficult part (mpl, ipython, or...?)
I'll also try to isolate some simple functions which does this... But this may
be hard to do.
thanks
Eric
From: Darren D. <dar...@co...> - 2008年05月13日 13:05:54
It would also be useful to know what matplotlib version and backend you are 
using, and what version of ipython. For what its worth, I use ipython -pylab 
with svn/bzr ipython and the qt4agg backend on a multicore machine without 
any problems. If you can, I suggest trying the development branch of ipython 
(not ipython1), there was some improvement to the threading code recently, 
although I don't know if it would relate to the problem you reported.
Darren
On Tuesday 13 May 2008 8:09:38 am Michael Droettboom wrote:
> That's a good one ;) There are some pretty clever things done with
> threading when you do "ipython -pylab" to make the GUI and the shell
> responsive at the same time. I wonder if you've entered a race
> condition/deadlock or something. A useful piece of information is
> whether you are running on a multi-core machine. Have you ever seen it
> lock up if you don't use "-pylab"? (In that case it would be normal for
> the shell to stop responding, but the GUI should still repaint and
> resize etc.)
>
> There may be others on this list who are of more help than me, but you
> may also want to ask your question on the ipython mailing list if we
> can't solve it here. I suspect this is related to the interaction of
> the two projects.
>
> Cheers,
> Mike
>
> Eric Emsellem wrote:
> > Hi,
> >
> > I am having a recurrent (and very annoying) problem with plotting.
> >
> > Basically: I enter my Ipython session (with -pylab), execute a few
> > commands from locally developed modules, and then try to make one plot.
> > The plot does not appear (I don't get back the command line), and my
> > session is then completely stuck, and I have no other way out (as far as
> > I could find) than to just do a shell "kill" of my Ipython session.
> > I then RE-enter the Ipython session, relaunch the exact SAME commands,
> > including the plotting one, and there it works.
> >
> > This happens very frequently (first trial = I get stuck with the first
> > plotting, then after killing the session and redoing the same thing, it
> > works).
> >
> > This is VERY annoying specially as some of the calculations I commonly
> > use are quite long (which makes it very difficult for me to provide more
> > info here, sorry...). I guess this may be a memory problem of some sort?
> > Any clue of either how to solve this or at least how to find out what is
> > exactly the problem?
> >
> > thanks for your help
> >
> > Eric
> > ========
> > CONFIG =
> > ========
> > Under OpenSuse 10.3 (x86_64)
> >
> > matplotlib version 0.90.1
> > verbose.level helpful
> > interactive is False
> > units is False
> > platform is linux2
> > numerix numpy 1.0.3.1
> > font search path
> > ['/usr/lib64/python2.5/site-packages/matplotlib/mpl-data/fonts/ttf',
> > '/usr/lib64/python2.5/site-packages/matplotlib/mpl-data/fonts/afm']
> > matplotlib data path
> > /usr/lib64/python2.5/site-packages/matplotlib/mpl-data backend WXAgg
> > version 2.8.4.0
> > Python 2.5.1 (r251:54863, Jan 10 2008, 18:00:49)
> > IPython 0.8.1 -- An enhanced Interactive Python.
> >
> > -------------------------------------------------------------------------
> > This SF.net email is sponsored by: Microsoft
> > Defy all challenges. Microsoft(R) Visual Studio 2008.
> > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> > _______________________________________________
> > Matplotlib-users mailing list
> > Mat...@li...
> > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
-- 
Darren S. Dale, Ph.D.
dd...@co...
From: Michael D. <md...@st...> - 2008年05月13日 12:20:03
This looks like the same symptoms as this (unresolved) bug here:
http://sourceforge.net/tracker/index.php?func=detail&aid=1949982&group_id=80706&atid=560720
Your gdb backtrace reveals that you have debugging symbols in 
matplotlib, so we've got a little more information now. Thanks.
Since this crash is in an inlined C++ method, I would try forcing a 
clean rebuild of matplotlib (by deleting the build directory under the 
source tree) and rebuilding/reinstalling. Beyond that, I'm a little 
stumped. Could you run the following in gdb when the crash happens?
p bboxo
p bbox
p bbox->_ll
Cheers,
Mike
Malte Marquarding wrote:
> Hi,
>
> I had a look through the archives but couldn't find an answer to this.
> Using the tkagg backend (agg is fine) I get a segmentation fault 
> doing a simple plot.
> gdb returns the following:
>
> 362 Point* ll_api() {return _ll;}
> Current language: auto; currently c++
> (gdb) bt
> #0 0xb6fc1bac in PyAggImagePhoto (clientdata=0x0, interp=0x87a9430, 
> argc=5,
> argv=0xbf97fc9c) at src/_transforms.h:362
> #1 0xb712ea5c in TclInvokeStringCommand () from /usr/lib/libtcl8.4.so
> #2 0xb712ff05 in TclEvalObjvInternal () from /usr/lib/libtcl8.4.so
> #3 0xb7131015 in Tcl_EvalObjv () from /usr/lib/libtcl8.4.so
> #4 0xb73d34a6 in ?? () from /usr/lib/python2.5/lib-dynload/_tkinter.so
> snip
>
> This is matplotlib-0.91.2, python 2.5 on linux (opensuse 10.3)
>
>
> Cheers,
> Malte.
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft 
> Defy all challenges. Microsoft(R) Visual Studio 2008. 
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA
From: Michael D. <md...@st...> - 2008年05月13日 12:09:49
That's a good one ;) There are some pretty clever things done with 
threading when you do "ipython -pylab" to make the GUI and the shell 
responsive at the same time. I wonder if you've entered a race 
condition/deadlock or something. A useful piece of information is 
whether you are running on a multi-core machine. Have you ever seen it 
lock up if you don't use "-pylab"? (In that case it would be normal for 
the shell to stop responding, but the GUI should still repaint and 
resize etc.)
There may be others on this list who are of more help than me, but you 
may also want to ask your question on the ipython mailing list if we 
can't solve it here. I suspect this is related to the interaction of 
the two projects.
Cheers,
Mike
Eric Emsellem wrote:
> Hi,
>
> I am having a recurrent (and very annoying) problem with plotting.
>
> Basically: I enter my Ipython session (with -pylab), execute a few commands from
> locally developed modules, and then try to make one plot. The plot does not
> appear (I don't get back the command line), and my session is then completely
> stuck, and I have no other way out (as far as I could find) than to just do a
> shell "kill" of my Ipython session.
> I then RE-enter the Ipython session, relaunch the exact SAME commands, including
> the plotting one, and there it works.
>
> This happens very frequently (first trial = I get stuck with the first plotting,
> then after killing the session and redoing the same thing, it works).
>
> This is VERY annoying specially as some of the calculations I commonly use are
> quite long (which makes it very difficult for me to provide more info here,
> sorry...). I guess this may be a memory problem of some sort? Any clue of either
> how to solve this or at least how to find out what is exactly the problem?
>
> thanks for your help
>
> Eric
> ========
> CONFIG =
> ========
> Under OpenSuse 10.3 (x86_64)
>
> matplotlib version 0.90.1
> verbose.level helpful
> interactive is False
> units is False
> platform is linux2
> numerix numpy 1.0.3.1
> font search path
> ['/usr/lib64/python2.5/site-packages/matplotlib/mpl-data/fonts/ttf',
> '/usr/lib64/python2.5/site-packages/matplotlib/mpl-data/fonts/afm']
> matplotlib data path /usr/lib64/python2.5/site-packages/matplotlib/mpl-data
> backend WXAgg version 2.8.4.0
> Python 2.5.1 (r251:54863, Jan 10 2008, 18:00:49)
> IPython 0.8.1 -- An enhanced Interactive Python.
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft 
> Defy all challenges. Microsoft(R) Visual Studio 2008. 
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA
From: Michael D. <md...@st...> - 2008年05月13日 12:09:13
Presently, there's no direct way to do this. matplotlib uses the 
standard Python (derived from C) number formatting which uses a hyphen. 
There are a couple of workarounds, however.
You can set a custom tick formatter by providing a function and wrapping 
it in a FuncFormatter object. (See attached). You can have your 
function replace all of the hyphens with minus signs, or force it to use 
the mathtext formatting (which uses minus signs by default) by wrapping 
the text in '$'. Alternatively, if your plot is designed for inclusion 
in t a (La)TeX document, you can turn usetex on in your matplotlibrc.
All that said, it might be nice to make this the default behavior in 
future versions of matplotlib. We're about to make a release, so I 
don't want to put this in right now. Could you possibly file a "Feature 
Request" in the tracker so we don't lose track of this?
Cheers,
Mike
Markus Kuhn wrote:
> Matplotlib currently uses the "hyphen" character instead of a "minus
> sign" when printing negative numbers in plots.
>
> While these two characters are traditionally not distinguished in
> monospaced fonts, there is a big difference in proportional fonts. A
> hyphen (Unicode character 0x002d) is very short and used between words,
> whereas a minus sign (Unicode: 0x2212) is much longer and looks exactly
> like the horizontal part of a plus sign.
>
> Practically all modern fonts do contain a minus sign. In those fonts
> that still lack a minus sign, the (often slightly lower/thinner/longer)
> "en dash" is usually a much less painful substitute than the hyphen.
> [The PostScript standard encoding lacks a minus sign, but the PostScript
> symbol font has one at 0x2d, as documented in
> http://www.unicode.org/Public/MAPPINGS/VENDORS/ADOBE/symbol.txt ]
>
> Example:
>
> from pylab import *
> plot([-3, -2, -1], [1,-3,-2])
> title(u"wrong: -2..+2 correct: \u22122..+2")
> show()
>
> Is there a way to cause matplotlib to use the correct minus-sign glyph?
> That would help to keep typographically very picky editors of scientific
> journals happy ...
>
> Markus
>
> 
-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA
From: Michael D. <md...@st...> - 2008年05月13日 12:04:17
Your matplotlib is probably configured to use a GUI backend. Set the 
backend to "pdf" in either your matplotlibrc file or with
import matplotlib
matplotlib.use("pdf")
at the top of your script.
If you still see flashing windows, that's a bug, and let us know so we 
can fix it.
Cheers,
Mike
Neal Becker wrote:
> To produce a batch of pdfs, I'm using:
>
> close ()
> figure (1, figsize=(11,8))
> ...
> savefig (open (whatever, 'w'))
>
> Works, but causes my display to flash, I think each time either close() or
> figure() is called (not sure which). Any better way?
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
> Don't miss this year's exciting event. There's still time to save 100ドル. 
> Use priority code J8TL2D2. 
> http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA
From: Michael D. <md...@st...> - 2008年05月13日 12:02:08
Attachments: custom_minus.py
Forgot to attach example. Sorry.
Michael Droettboom wrote:
> Presently, there's no direct way to do this. matplotlib uses the 
> standard Python (derived from C) number formatting which uses a 
> hyphen. There are a couple of workarounds, however.
>
> You can set a custom tick formatter by providing a function and 
> wrapping it in a FuncFormatter object. (See attached). You can have 
> your function replace all of the hyphens with minus signs, or force it 
> to use the mathtext formatting (which uses minus signs by default) by 
> wrapping the text in '$'. Alternatively, if your plot is designed for 
> inclusion in t a (La)TeX document, you can turn usetex on in your 
> matplotlibrc.
>
> All that said, it might be nice to make this the default behavior in 
> future versions of matplotlib. We're about to make a release, so I 
> don't want to put this in right now. Could you possibly file a 
> "Feature Request" in the tracker so we don't lose track of this?
>
> Cheers,
> Mike
>
> Markus Kuhn wrote:
>> Matplotlib currently uses the "hyphen" character instead of a "minus
>> sign" when printing negative numbers in plots.
>>
>> While these two characters are traditionally not distinguished in
>> monospaced fonts, there is a big difference in proportional fonts. A
>> hyphen (Unicode character 0x002d) is very short and used between words,
>> whereas a minus sign (Unicode: 0x2212) is much longer and looks exactly
>> like the horizontal part of a plus sign.
>>
>> Practically all modern fonts do contain a minus sign. In those fonts
>> that still lack a minus sign, the (often slightly lower/thinner/longer)
>> "en dash" is usually a much less painful substitute than the hyphen.
>> [The PostScript standard encoding lacks a minus sign, but the PostScript
>> symbol font has one at 0x2d, as documented in
>> http://www.unicode.org/Public/MAPPINGS/VENDORS/ADOBE/symbol.txt ]
>>
>> Example:
>>
>> from pylab import *
>> plot([-3, -2, -1], [1,-3,-2])
>> title(u"wrong: -2..+2 correct: \u22122..+2")
>> show()
>>
>> Is there a way to cause matplotlib to use the correct minus-sign glyph?
>> That would help to keep typographically very picky editors of scientific
>> journals happy ...
>>
>> Markus
>>
>> 
>
-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA
From: Fabrice S. <si...@lm...> - 2008年05月13日 07:44:45
Le lundi 12 mai 2008 à 11:08 +0200, Johann Cohen-Tanugi a écrit :
> hello,
> I have a function, which I am plotting. I want to add a line positioned 
> at, say, the mean of the function, so I want to do plot([x,x],[y0,y1]).
> In order to get y0, and y1, my brute force trial and error browsing of 
> the API lead me to :
> y0=gca().yaxis.get_majorticklabels()[0].get_position()[1]
> y1=gca().yaxis.get_majorticklabels()[-1].get_position()[1]
line = gca().get_lines()[0]
y0 = line.get_ydata().min()
y1 = line.get_ydata().max()
should work (sorry I did not checked)
-- 
Fabricio
From: Eric E. <ems...@ob...> - 2008年05月13日 07:32:30
Hi,
I am having a recurrent (and very annoying) problem with plotting.
Basically: I enter my Ipython session (with -pylab), execute a few commands from
 locally developed modules, and then try to make one plot. The plot does not
appear (I don't get back the command line), and my session is then completely
stuck, and I have no other way out (as far as I could find) than to just do a
shell "kill" of my Ipython session.
I then RE-enter the Ipython session, relaunch the exact SAME commands, including
the plotting one, and there it works.
This happens very frequently (first trial = I get stuck with the first plotting,
then after killing the session and redoing the same thing, it works).
This is VERY annoying specially as some of the calculations I commonly use are
quite long (which makes it very difficult for me to provide more info here,
sorry...). I guess this may be a memory problem of some sort? Any clue of either
how to solve this or at least how to find out what is exactly the problem?
thanks for your help
Eric
========
CONFIG =
========
Under OpenSuse 10.3 (x86_64)
matplotlib version 0.90.1
verbose.level helpful
interactive is False
units is False
platform is linux2
numerix numpy 1.0.3.1
font search path
['/usr/lib64/python2.5/site-packages/matplotlib/mpl-data/fonts/ttf',
'/usr/lib64/python2.5/site-packages/matplotlib/mpl-data/fonts/afm']
matplotlib data path /usr/lib64/python2.5/site-packages/matplotlib/mpl-data
backend WXAgg version 2.8.4.0
Python 2.5.1 (r251:54863, Jan 10 2008, 18:00:49)
IPython 0.8.1 -- An enhanced Interactive Python.
From: Alan J. <al...@aj...> - 2008年05月13日 03:08:35
I have an example of fitting distributions to bus arrival times using
'R' that may be helpful. I wanted to calculate the latest time I could
arrive at the bus stop and have a better than 95% chance of catching
the bus. I tend to use R and Scipy whereever each is strongest.
http://www.oplnk.net/~ajackson/software/
http://www.oplnk.net/~ajackson/software/BusStats.R
On 2008年5月11日 18:49:58 -0500
glenn andrews <ga...@ag...> wrote:
> I have been working on a similar problem related to finance. What I 
> have done is call the "R" statistical software from Python and then use 
> matplotlib for graphing within Python
> 
> I use Python2.4, the "R" statistical package, and a Python package 
> called rpy which interfaces to "R" from Python
> 
> LINKs:
> http://rpy.sourceforge.net/
> http://www.r-project.org/
> 
> My tendency is to submit the data to "R" which does the statistical 
> calculations, return the results to Python, and then use Matplotlib to 
> plot. Keep in mind that "R" also has good plotting capabilities and you 
> might just go with that solution. 
> 
> 
> 
> ###########################################
> 
> 
> Eric Firing wrote:
> 
> >You might get a good answer here (although I don't have it), but be 
> >aware that your question relates to math, not plotting, so it is not 
> >really a matplotlib question. You need nonlinear least-squares. Look 
> >in scipy, and try the amazing Google.
> >
> >Eric
> >
> >Adrian Price-Whelan wrote:
> > 
> >
> >>Hey guys -
> >>
> >>I'm working on a Histogram of pixel values from an astronomical image 
> >>that looks like a Gaussian curve and then polynomial decay. I'm 
> >>trying to figure out a way to fit a Gaussian regression to the 
> >>histogram, but can't find any documentation on this. thanks!
> >>
> >>-adrian
> >> 
> >>
> >
> >-------------------------------------------------------------------------
> >This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
> >Don't miss this year's exciting event. There's still time to save 100ドル. 
> >Use priority code J8TL2D2. 
> >http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
> >_______________________________________________
> >Matplotlib-users mailing list
> >Mat...@li...
> >https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> >
> > 
> >
> 
> 
> -------------------------------------------------------------------------
> This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
> Don't miss this year's exciting event. There's still time to save 100ドル. 
> Use priority code J8TL2D2. 
> http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
-- 
-----------------------------------------------------------------------
| Alan K. Jackson | To see a World in a Grain of Sand |
| al...@aj... | And a Heaven in a Wild Flower, |
| www.ajackson.org | Hold Infinity in the palm of your hand |
| Houston, Texas | And Eternity in an hour. - Blake |
-----------------------------------------------------------------------
From: KURT P. <pet...@ms...> - 2008年05月13日 03:06:59
I have a simple window to open a file that the data is then used to make a 
graph:
The code for that part is:
=====code========
window = Tkinter.Tk()
 #window.withdraw() <-- not sure what this does
 window.title('hello world')
 w = Tkinter.Label(window,text="hello, again")
 w.pack
 menubar = Tkinter.Menu(window)
 mfile = Tkinter.Menu(menubar, tearoff = 0)
 mfile.add_command(label="Open", command=callback)
 mfile.add_command(label="Save", command=callback)
 menubar.add_cascade(label="File", menu=mfile)
 window.config(menu=menubar)
 errmsg = 'Error!'
 of_But = Tkinter.Button(window, text= "Open File", command=callback)
 of_But.pack()
 #Button(text='Quit', command=(lambda: showerror('Sure you want to 
quit?', errmsg))).pack(fill=X)
 q = Tkinter.Button(window, text="Quit", fg="red", command=window.quit)
 q.pack()
 window.mainloop()
================
I then create a map :
=====code=====
 m1 = 
Basemap(llcrnrlon=-119,llcrnrlat=22,urcrnrlon=-64,urcrnrlat=49,\
 
projection='lcc',lat_1=33,lat_2=45,lon_0=-95,resolution='l')
 shp_info = 
m1.readshapefile(r'C:\Python25\Lib\basemap-0.9.9.1\examples\citiesx020','states',drawbounds=True)
 ax=p.gca()
 seqnum={}
 criteriatodisplay=[]
 names={}
 for seq, shapedict in enumerate(m1.states_info):
 if int(shapedict['POP_2000'])>150000:
 seqnum[seq]=shapedict['NAME']
 criteriatodisplay.append(seq)
 m1.drawcoastlines()
 m1.fillcontinents()
 m1.drawcountries()
 m1.drawstates()
 m1.drawparallels(p.arange(25,65,4),labels=[1,0,0,0])
 m1.drawmeridians(p.arange(-120,-40,4),labels=[0,0,0,1])
 p.show()
======
But when I click on quit, I get this error:
Fatal Python error: PyEval_RestoreThread: NULL tstate
This application has requested the Runtime to terminate it in an unusual 
way.
Please contact the application's support team for more information.
It's not that big of a deal since I'm quitting anyways, but does anyone know 
how to fix this?
Kurt

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