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
(20) |
2
(16) |
3
(9) |
4
(12) |
5
(14) |
6
(22) |
|
7
(17) |
8
(33) |
9
(26) |
10
(32) |
11
(47) |
12
(26) |
13
(7) |
|
14
(24) |
15
(44) |
16
(42) |
17
(22) |
18
(31) |
19
(8) |
20
(4) |
|
21
(15) |
22
(27) |
23
(41) |
24
(33) |
25
(31) |
26
(24) |
27
(10) |
|
28
(20) |
|
|
|
|
|
|
|
From: Tomasz K. <t.k...@ci...> - 2010-02-10 11:43:38
|
I noticed that the hatching looks wrong only when viewed i the OS X 'preview' software or for example inside of a Lyx document. But, when compiled into a DVI or PDF it looks fine. If I have a spare moment at some point I will give it a closer look. Tomek On 9 Feb 2010, at 23:56, Michiel de Hoon wrote: > I wasn't able to replicate this problem with the Mac OS X backend > with matplotlib 0.99.1.1. Both the on-screen figure and the ps > output look fine. > > --Michiel. > |
|
From: Nils W. <nw...@ia...> - 2010-02-10 11:21:21
|
Hi all,
How can I combine onpick events with annotate ?
Any pointer would be appreciated.
import numpy as np
import matplotlib.pyplot as plt
fig = plt.figure()
ax = fig.add_subplot(111)
ax.set_title('click on points')
line, = ax.plot(np.random.rand(100), 'o', picker=5) # 5
points tolerance
def onpick(event):
thisline = event.artist
xdata = thisline.get_xdata()
ydata = thisline.get_ydata()
ind = event.ind
print 'onpick points:', zip(xdata[ind], ydata[ind]),
ind
ax.annotate('Test',xy=(ind,
ydata[ind]),horizontalalignment='left',verticalalignment='top')
# ax.redraw_in_frame()
fig.canvas.mpl_connect('pick_event', onpick)
plt.show()
Thanks in advance.
Nils
|
|
From: Brendan B. <bre...@br...> - 2010-02-10 08:31:51
|
I'm trying to do an animation which plots a large number of items on
two dimensions, and then animates their positions over time. I have
set up the plot with my dimensions on the axes and am using
canvas.blit (as shown in one of the examples) to update my plot. I'm
using text as the markers --- that is, I use the text function to
display the label of each item (not just a point) at its location on
the graph.
The problem is that I have a large amount of data. There are over
100,000 "steps" in my time sequence (i.e., places where I might need
to update the display because some item moved), and even though not
all of those actually result in a change in the positions, there are
still several thousand distinct items that need to be plotted and
moved around. I'm currently buffering this a bit so that I only
update on every Nth data point, but it's still rather slow.
I can see one obvious, issue, but I'm not sure how to work around it.
The thing is that a large number of the items don't actually move
around very much over time, and even if one does move around
relatively frequently, there may be long stretches where it doesn't.
Yet, on every display update, I am redrawing all 1000+ artists. I
feel like there should be some way to move only the points that need
to be moved, but I'm not sure how to do it. My idea for how to
improve it is that, for each display update, I would look at which
bits of text actually do need to move, look at where they currently
are, calculate which other texts overlap with those moving, then blit
a blank rectangle onto the "old" positions of the moving items, and
redraw only the moving items and those that were partially erased by
the blank. This way items that were nowhere near any change wouldn't
need to be redrawn.
Is this feasible? Is there a standard way to go about this? Is
there any way to figure out which artists overlap without looping over
the list of all artists and checking the bbox bounds? Any other
suggestions on how to do it?
Thanks,
--
Brendan Barnwell
"Do not follow where the path may lead. Go, instead, where there is
no path, and leave a trail."
--author unknown
|
|
From: Gökhan S. <gok...@gm...> - 2010-02-10 06:33:15
|
On Tue, Feb 9, 2010 at 8:15 PM, Wayne Watson <sie...@sb...>wrote: > Subject is the question. > > As I see it, it's useful to know MatLab. A simple query with matplotlib > tutorial shows a number of hits. The first, reference to v0.99.a > documentation barely qualifies. Examples galore and a pretty minimal > introduction. In the first 10 or so hits ther's a blog and mention of a > video. The blog may appeal to some, but it seems unelementary. The video > basically asks to sign in. Who knows where that goes? I've seen a few > videos for MPL, but they all look tied into $$. > > I've made some reasonable progress on MPL, but am still far short of > being confident of using it. Too much try this and see. > > I know of exactly one book on MPL ( for scientists. sounds interesting). > It was published recently by a foreign author. It is not yet widely > distributed. > > Your turn. Comments? > -- > "Crime is way down. War is declining. And that's far from the good > news." -- Steven Pinker (and other sources) Why is this true, but yet > the media says otherwise? The media knows very well how to manipulate us > (see limbic, emotion, $$). -- WTW > > > ------------------------------------------------------------------------------ > SOLARIS 10 is the OS for Data Centers - provides features such as DTrace, > Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW > http://p.sf.net/sfu/solaris-dev2dev > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > For me best way to learn is to use it actually :) Especially on homework and projects. Mailing lists are also very helpful as you are already doing. Try with ipython --pylab option. Also check SciPy09 (http://conference.scipy.org/SciPy2009/) videos. There are one introductory and advanced tutorials that you can see online (without registering) or downloading to your computer. -- Gökhan |
|
From: Christoph G. <cg...@uc...> - 2010-02-10 03:17:43
|
To close this thread: the PyEval_RestoreThread crash is a known bug in
the tkagg backend on Windows. See line 375 of backend_tkagg.py:
def show(self):
"""
this function doesn't segfault but causes the
PyEval_RestoreThread: NULL state bug on win32
"""
-- Christoph
On 2/9/2010 10:26 AM, Christoph Gohlke wrote:
> Change the last line to pylab.show() and it should work.
>
> Anyway, this example should not crash the interpreter. I can reproduce
> the crash on Python 2.4, 2.5, and 2.6 (32 and 64 bit) on Windows with
> mpl 0.99.1 but not on Ubuntu 9.1 with mpl 0.99.0.
>
> The shortest example that crashes is:
>
> python -c "import pylab;pylab.subplot(111).figure.show()"
>
> or on the interactive prompt:
>
>>>> import pylab
>>>> pylab.subplot(111).figure.show()
>>>> exit()
> 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.
>
>
> -- Christoph
>
> On 2/9/2010 7:57 AM, Lee Boger wrote:
>> >
>> > Windows XP Professional with Python 2.5 installed (pywin32 build 210) -
>> > came with dSPACE software package
>> >
>> > Downloaded and installed matplotlib-0.99.1.win32-py2.5.exe from
>> > sourceforge.net
>> >
>> > Downloaded and installed numpy-1.4.0-win32-superpack-python2.5.exe from
>> > sourceforge.net
>> >
>> > Executing the following simple "log plot" script within PythonWin:
>> >
>> > *from* matplotlib *import* pylab
>> >
>> > # Create some artificial data.
>> > test_frequency = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
>> > 17, 18, 19, 20]
>> > test_results = [-0.2, -0.7, -1.0, -1.5, -2.0, -2.5, -3.0, -3.5, -4, -5,
>> > -6, -7.1, -8, -9, -10, -11, -12, -15, -20, -25]
>> > spec_frequency = [6, 8]
>> > spec_results = [-3.0, -3.0]
>> >
>> > # Plot
>> > figure = pylab.subplot(111)
>> > figure.semilogx()
>> > figure.scatter(test_frequency, test_results, s=20, c='b', marker='s',
>> > edgecolors='none')
>> > figure.scatter(spec_frequency, spec_results, s=40, c='g', marker='s',
>> > edgecolors='none')
>> > figure.grid(True)
>> > figure.set_xlabel(r"Frequency (Hz)", fontsize = 12)
>> > figure.set_ylabel(r"Actuator Response (db)", fontsize = 12)
>> >
>> > figure.figure.savefig('log_plot')
>> > figure.figure.show()
>> >
>> >
>> > Plots a figure on the screen that looks correct, then the following
>> > error (when I click OK, PythonWin closes)
>> >
>> >
>> >
>> > Any advice would be appreciated. Maybe it's an installation or setup
>> > issue, but I'm pretty knew to Python programming and don't know how to
>> > debug this.
>> >
>> > Lee Boger
|
|
From: C M <cmp...@gm...> - 2010-02-10 02:47:01
|
<sie...@sb...> wrote: > Subject is the question. > > As I see it, it's useful to know MatLab. A simple query with matplotlib > tutorial shows a number of hits. The first, reference to v0.99.a > documentation barely qualifies. Examples galore and a pretty minimal > introduction. In the first 10 or so hits ther's a blog and mention of a > video. The blog may appeal to some, but it seems unelementary. The video > basically asks to sign in. Who knows where that goes? I've seen a few > videos for MPL, but they all look tied into $$. > > I've made some reasonable progress on MPL, but am still far short of > being confident of using it. Too much try this and see. > > I know of exactly one book on MPL ( for scientists. sounds interesting). > It was published recently by a foreign author. It is not yet widely > distributed. > > Your turn. Comments? Have you read the manual itself? I found that quite helpful in getting started: http://matplotlib.sourceforge.net/users/index.html I've been satisfied with learning a bit here and there as I go. It's a big project, and I don't expect to understand it all at once. But, that said, even with a partial understanding I'm pleased at what it can do for my needs. What I find is first you should determine what is the desired outcome you want, then Google around for mentions of this in old threads or on the matplotlib site, then maybe try asking for assistance on the list. Che |
|
From: Wayne W. <sie...@sb...> - 2010-02-10 02:15:58
|
Subject is the question. As I see it, it's useful to know MatLab. A simple query with matplotlib tutorial shows a number of hits. The first, reference to v0.99.a documentation barely qualifies. Examples galore and a pretty minimal introduction. In the first 10 or so hits ther's a blog and mention of a video. The blog may appeal to some, but it seems unelementary. The video basically asks to sign in. Who knows where that goes? I've seen a few videos for MPL, but they all look tied into $$. I've made some reasonable progress on MPL, but am still far short of being confident of using it. Too much try this and see. I know of exactly one book on MPL ( for scientists. sounds interesting). It was published recently by a foreign author. It is not yet widely distributed. Your turn. Comments? -- "Crime is way down. War is declining. And that's far from the good news." -- Steven Pinker (and other sources) Why is this true, but yet the media says otherwise? The media knows very well how to manipulate us (see limbic, emotion, $$). -- WTW |
|
From: Yannick C. <yan...@la...> - 2010-02-10 01:02:36
|
Hi List, I made a script to draw very simple (single-direction single-input single-sided single-everything) Sankey diagrams (attached). I think I could share, if it can be of any use... Cheers, Yannick |
|
From: Michiel de H. <mjl...@ya...> - 2010-02-09 23:56:17
|
I wasn't able to replicate this problem with the Mac OS X backend with matplotlib 0.99.1.1. Both the on-screen figure and the ps output look fine. --Michiel. --- On Tue, 2/9/10, Jae-Joon Lee <lee...@gm...> wrote: > From: Jae-Joon Lee <lee...@gm...> > Subject: Re: [Matplotlib-users] hatching problem > To: "Tomasz Koziara" <t.k...@ci...> > Cc: mat...@li... > Date: Tuesday, February 9, 2010, 10:42 AM > I cannot reproduce it with Agg > backend and ps backend. I tried both > svn version and 0.99 maint. version. > So, maybe this is a bug in mac os X backend? > Do you see a same problem with the ps output? If so, can > you post your > ouput ps file? > > Regards, > > -JJ > > > On Mon, Feb 8, 2010 at 3:26 PM, Tomasz Koziara > <t.k...@ci...> > wrote: > > Dear Users/Developers > > > > I just installed version 0.99.1.1 since in my previous > version (0.98) I had > > problems with hatching. It seems though that the same > problems persist in > > the current version. The attached files reproduce the > problem (a data file > > and a python short script). Note that hatching is not > present on all green > > 'CONUPD' fields - but only on few of them. > > > > I will appreciate some hints on how to get by, > > Regards > > Tomek > > > > =================== > > > > > > > > > > > > > > =================== > > > > dh178-192:tkp5 tomek$ python plots.py > --verbose-helpful > > $HOME=/Users/tomek > > CONFIGDIR=/Users/tomek/.matplotlib > > matplotlib data path > /Library/Python/2.5/site-packages/matplotlib/mpl-data > > loaded rc file > > > /Library/Python/2.5/site-packages/matplotlib/mpl-data/matplotlibrc > > matplotlib version 0.99.1.1 > > verbose.level helpful > > interactive is False > > units is False > > platform is darwin > > Using fontManager instance from > /Users/tomek/.matplotlib/fontList.cache > > backend MacOSX version unknown > > findfont: Matching > > > :family=sans-serif:style=normal:variant=normal:weight=normal:stretch=normal:size=medium > > to Bitstream Vera Sans > > > (/Library/Python/2.5/site-packages/matplotlib-0.98.6svn-py2.5-macosx-10.3-fat.egg/matplotlib/mpl-data/fonts/ttf/Vera.ttf) > > with score of 0.000000 > > findfont: Matching > > > :family=sans-serif:style=normal:variant=normal:weight=normal:stretch=normal:size=large > > to Bitstream Vera Sans > > > (/Library/Python/2.5/site-packages/matplotlib-0.98.6svn-py2.5-macosx-10.3-fat.egg/matplotlib/mpl-data/fonts/ttf/Vera.ttf) > > with score of 0.000000 > > > > > > > ------------------------------------------------------------------------------ > > The Planet: dedicated and managed hosting, cloud > storage, colocation > > Stay online with enterprise data centers and the best > network in the > > business > > Choose flexible plans and management services without > long-term contracts > > Personal 24x7 support from experience hosting pros > just a phone call away. > > http://p.sf.net/sfu/theplanet-com > > _______________________________________________ > > Matplotlib-users mailing list > > Mat...@li... > > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > > > > > ------------------------------------------------------------------------------ > The Planet: dedicated and managed hosting, cloud storage, > colocation > Stay online with enterprise data centers and the best > network in the business > Choose flexible plans and management services without > long-term contracts > Personal 24x7 support from experience hosting pros just a > phone call away. > http://p.sf.net/sfu/theplanet-com > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
|
From: Christoph G. <cg...@uc...> - 2010-02-09 21:35:21
|
I can now reproduce this. It seems the same old problem that PythonWin can not reliably run matplotlib because successive runs of the script use the same interpreter. Ipython should work. Append pylab.close() to your script; at least it will not crash on the second run. -- Christoph On 2/9/2010 10:44 AM, Lee Boger wrote: > > Although, if I close the figure then re-run the script, a new figure > pops up but it doesn't have any data plotted. Interpreter is now locked > up. I'm still not fixing it completely. There is also no figure stored > as a file log_plot. > > Lee > > > *Christoph Gohlke <cg...@uc...>* > > 02/09/2010 01:23 PM > > > To > Lee Boger <Bog...@ca...> > cc > > Subject > Re: [Matplotlib-users] Runtime Error - Need Advice > > > > > > Caterpillar: Confidential Green Retain Until: 03/11/2010 > > > > > Change the last line to pylab.show() and it should work. > > Anyway, this example should not crash the interpreter. I can reproduce > the crash on Python 2.4, 2.5, and 2.6 (32 and 64 bit) on Windows with > mpl 0.99.1 but not on Ubuntu 9.1 with mpl 0.99.0. > > The shortest example that crashes is: > > python -c "import pylab;pylab.subplot(111).figure.show()" > > or on the interactive prompt: > >>>> import pylab >>>> pylab.subplot(111).figure.show() >>>> exit() > 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. > > > -- Christoph > > On 2/9/2010 7:57 AM, Lee Boger wrote: >> >> Windows XP Professional with Python 2.5 installed (pywin32 build 210) - >> came with dSPACE software package >> >> Downloaded and installed matplotlib-0.99.1.win32-py2.5.exe from >> sourceforge.net >> >> Downloaded and installed numpy-1.4.0-win32-superpack-python2.5.exe from >> sourceforge.net >> >> Executing the following simple "log plot" script within PythonWin: >> >> *from* matplotlib *import* pylab >> >> # Create some artificial data. >> test_frequency = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, >> 17, 18, 19, 20] >> test_results = [-0.2, -0.7, -1.0, -1.5, -2.0, -2.5, -3.0, -3.5, -4, -5, >> -6, -7.1, -8, -9, -10, -11, -12, -15, -20, -25] >> spec_frequency = [6, 8] >> spec_results = [-3.0, -3.0] >> >> # Plot >> figure = pylab.subplot(111) >> figure.semilogx() >> figure.scatter(test_frequency, test_results, s=20, c='b', marker='s', >> edgecolors='none') >> figure.scatter(spec_frequency, spec_results, s=40, c='g', marker='s', >> edgecolors='none') >> figure.grid(True) >> figure.set_xlabel(r"Frequency (Hz)", fontsize = 12) >> figure.set_ylabel(r"Actuator Response (db)", fontsize = 12) >> >> figure.figure.savefig('log_plot') >> figure.figure.show() >> >> >> Plots a figure on the screen that looks correct, then the following >> error (when I click OK, PythonWin closes) >> >> >> >> Any advice would be appreciated. Maybe it's an installation or setup >> issue, but I'm pretty knew to Python programming and don't know how to >> debug this. >> >> Lee Boger >> >> >> >> ------------------------------------------------------------------------------ >> The Planet: dedicated and managed hosting, cloud storage, colocation >> Stay online with enterprise data centers and the best network in the > business >> Choose flexible plans and management services without long-term contracts >> Personal 24x7 support from experience hosting pros just a phone call away. >> http://p.sf.net/sfu/theplanet-com >> >> >> >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
|
From: Ted K. <ted...@go...> - 2010-02-09 20:40:29
|
Paul The example works fine and was quite instructive. Thx. Ted On 8 February 2010 21:41, <PH...@ge...> wrote: > Ted, > > > > How does this example run for you? > > > http://matplotlib.sourceforge.net/examples/pylab_examples/griddata_demo.html > > > > *From:* Ted Kord [mailto:ted...@go...] > *Sent:* Monday, February 08, 2010 12:00 PM > *To:* Paul Hobson > *Cc:* mat...@li... > *Subject:* Re: [Matplotlib-users] Surface Plot > > > > On 8 February 2010 17:37, <PH...@ge...> wrote: > > Hey Ted, > > I don't quite understand how you're getting the Z data below. But if you > have 3D data in X, Y, and Z 1D-arrays, the griddata function should work for > you. > > http://matplotlib.sourceforge.net/api/mlab_api.html#matplotlib.mlab.griddata > > HTH, > -paul > > > > Hi Paul > > > > Is there a way to colour the output? For some reason, the final output is > in a single colour even though I've specified cm.jet for the colour map. > > > > Regards > > > > Ted > > > |
|
From: Lee B. <Bog...@ca...> - 2010-02-09 20:16:59
|
Python version 2.5.1, Tk version 8.4, IDLE version 1.2.1
Lee
Christoph Gohlke <cg...@uc...>
02/09/2010 03:08 PM
To
matplotlib-users <mat...@li...>
cc
Subject
Re: [Matplotlib-users] Runtime Error - Need Advice
Caterpillar: Confidential Green Retain Until: 03/11/2010
I am not sure what's going on. The script you posted imports pylab in
the first line. It should be defined. The scrit works just fine after
the proposed changes, even from Pythonwin. Did you completely quit
Pythonwin after the crashes and made sure no corrupted python instance
was left running? Please send the version string of your python
installation.
Christoph
On 2/9/2010 11:10 AM, Lee Boger wrote:
>
> Per another suggestion, I did uninstall numpy 1.4 and installed numpy
> 1.3, but got the same results. Using pylab.savefig('log_plot) resulted
> in the following error:
>
> Traceback (most recent call last):
> File "C:\Program Files\Common
>
Files\dSPACE\Python25\lib\site-packages\Pythonwin\pywin\framework\scriptutils.py",
> line 310, in RunScript
> exec codeObject in __main__.__dict__
> File "C:\Documents and Settings\BogerLC\My Documents\Script2.py", line
> 20, in <module>
> pylab.savefig('log_plot')
> NameError: name 'pylab' is not defined
>
> Using pyplot.savefig('log_plot') does not have an error, but I still get
> no file saved. Maybe it is a "backend" thing, which I know nothing
> about. I'll look into it. Thanks.
>
> Lee
>
>
> *Christoph Gohlke <cg...@uc...>*
>
> 02/09/2010 02:03 PM
>
>
> To
> matplotlib-users <mat...@li...>
> cc
>
> Subject
> Re: [Matplotlib-users] Runtime Error - Need Advice
>
>
>
>
>
> Caterpillar: Confidential Green Retain Until: 03/11/2010
>
>
>
>
> Use pylab.savefig('log_plot'). Also saving the figure to file and
> showing it interactively in the same script might involve switching
> backends, which might not work as expected.
>
> It is advisable to downgrade to numpy 1.3.
>
> -- Christoph
>
> On 2/9/2010 10:44 AM, Lee Boger wrote:
>>
>> Although, if I close the figure then re-run the script, a new figure
>> pops up but it doesn't have any data plotted. Interpreter is now locked
>> up. I'm still not fixing it completely. There is also no figure stored
>> as a file log_plot.
>>
>> Lee
>>
>>
>> *Christoph Gohlke <cg...@uc...>*
>>
>> 02/09/2010 01:23 PM
>>
>>
>> To
>> Lee Boger <Bog...@ca...>
>> cc
>>
>> Subject
>> Re: [Matplotlib-users] Runtime Error - Need Advice
>>
>>
>>
>>
>>
>> Caterpillar: Confidential Green Retain Until: 03/11/2010
>>
>>
>>
>>
>> Change the last line to pylab.show() and it should work.
>>
>> Anyway, this example should not crash the interpreter. I can reproduce
>> the crash on Python 2.4, 2.5, and 2.6 (32 and 64 bit) on Windows with
>> mpl 0.99.1 but not on Ubuntu 9.1 with mpl 0.99.0.
>>
>> The shortest example that crashes is:
>>
>> python -c "import pylab;pylab.subplot(111).figure.show()"
>>
>> or on the interactive prompt:
>>
>>>>> import pylab
>>>>> pylab.subplot(111).figure.show()
>>>>> exit()
>> 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.
>>
>>
>> -- Christoph
>>
>> On 2/9/2010 7:57 AM, Lee Boger wrote:
>>>
>>> Windows XP Professional with Python 2.5 installed (pywin32 build 210)
-
>>> came with dSPACE software package
>>>
>>> Downloaded and installed matplotlib-0.99.1.win32-py2.5.exe from
>>> sourceforge.net
>>>
>>> Downloaded and installed numpy-1.4.0-win32-superpack-python2.5.exe
from
>>> sourceforge.net
>>>
>>> Executing the following simple "log plot" script within PythonWin:
>>>
>>> *from* matplotlib *import* pylab
>>>
>>> # Create some artificial data.
>>> test_frequency = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
16,
>>> 17, 18, 19, 20]
>>> test_results = [-0.2, -0.7, -1.0, -1.5, -2.0, -2.5, -3.0, -3.5, -4,
-5,
>>> -6, -7.1, -8, -9, -10, -11, -12, -15, -20, -25]
>>> spec_frequency = [6, 8]
>>> spec_results = [-3.0, -3.0]
>>>
>>> # Plot
>>> figure = pylab.subplot(111)
>>> figure.semilogx()
>>> figure.scatter(test_frequency, test_results, s=20, c='b', marker='s',
>>> edgecolors='none')
>>> figure.scatter(spec_frequency, spec_results, s=40, c='g', marker='s',
>>> edgecolors='none')
>>> figure.grid(True)
>>> figure.set_xlabel(r"Frequency (Hz)", fontsize = 12)
>>> figure.set_ylabel(r"Actuator Response (db)", fontsize = 12)
>>>
>>> figure.figure.savefig('log_plot')
>>> figure.figure.show()
>>>
>>>
>>> Plots a figure on the screen that looks correct, then the following
>>> error (when I click OK, PythonWin closes)
>>>
>>>
>>>
>>> Any advice would be appreciated. Maybe it's an installation or setup
>>> issue, but I'm pretty knew to Python programming and don't know how to
>>> debug this.
>>>
>>> Lee Boger
>>>
>>>
>>>
>>>
>
------------------------------------------------------------------------------
>>> The Planet: dedicated and managed hosting, cloud storage, colocation
>>> Stay online with enterprise data centers and the best network in the
>> business
>>> Choose flexible plans and management services without long-term
contracts
>>> Personal 24x7 support from experience hosting pros just a phone call
away.
>>> http://p.sf.net/sfu/theplanet-com
>>>
>>>
>>>
>>> _______________________________________________
>>> Matplotlib-users mailing list
>>> Mat...@li...
>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>
>
------------------------------------------------------------------------------
> The Planet: dedicated and managed hosting, cloud storage, colocation
> Stay online with enterprise data centers and the best network in the
> business
> Choose flexible plans and management services without long-term
contracts
> Personal 24x7 support from experience hosting pros just a phone call
away.
> http://p.sf.net/sfu/theplanet-com
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
------------------------------------------------------------------------------
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
_______________________________________________
Matplotlib-users mailing list
Mat...@li...
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
|
|
From: Lee B. <Bog...@ca...> - 2010-02-09 20:11:01
|
I tried something that seems to work consistently - I get the correct plot figure and the correct log_plot.png file created everytime I run the script. >From the Start menu, I chose All Programs-Python2.5-IDLE (Python GUI) instead of All Programs-Python2.5-PythonWin, which creates the Tk Python Shell. I then open the script file and run it. I think you were right. Does this make sense? Lee __________________ Thanks for your help. I'll look into ipython. Lee Eric Firing <ef...@ha...> 02/09/2010 02:31 PM To Lee Boger <Bog...@ca...>, matplotlib-users <mat...@li...> cc Subject Re: [Matplotlib-users] Runtime Error - Need Advice Caterpillar: Confidential Green Retain Until: 03/11/2010 Lee Boger wrote: > > Thanks for the quick feedback. I changed the last line from > figure.figure.show() to pyplot.show() and it worked without crashing the > interpreter. However, if I close the figure then re-run the script, a > new figure pops up but it doesn't have any data plotted. Interpreter is > now locked up, the run-time error occurred and no figure stored as a > file log_plot. I un-installed numpy-1.4.0 and installed numpy-1.3.0, but > the results were as I just described. > > Lee > At this point a Windows user may need to step in. I know nothing about PythonWin. My suspicion is that this is a problem of dueling event loops, and one solution would be to use ipython instead of pythonwin. (Note that you typically need to use "reply to all" on this list, otherwise the reply does not get copied to the list.) Eric > > > *Eric Firing <ef...@ha...>* > > 02/09/2010 01:35 PM > > > To > Lee Boger <Bog...@ca...> > cc > mat...@li... > Subject > Re: [Matplotlib-users] Runtime Error - Need Advice > > > > > > Caterpillar: Confidential Green Retain Until: 03/11/2010 > > > > > Lee Boger wrote: > > > > Windows XP Professional with Python 2.5 installed (pywin32 build 210) - > > came with dSPACE software package > > > > Downloaded and installed matplotlib-0.99.1.win32-py2.5.exe from > > sourceforge.net > > > > Downloaded and installed numpy-1.4.0-win32-superpack-python2.5.exe from > > sourceforge.net > > I suspect this is the problem: numpy-1.4.0 is considered broken and has > been withdrawn. Specifically, it introduces binary incompatibility with > programs compiled against prior versions of numpy, including matplotlib. > If you go back to the numpy sourceforge site now, I think you will see > an earlier version that you can install in place of 1.4.0 (after > removing the latter). > > Eric > > > > > Executing the following simple "log plot" script within PythonWin: > > > > *from* matplotlib *import* pylab > > > > # Create some artificial data. > > test_frequency = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, > > 17, 18, 19, 20] > > test_results = [-0.2, -0.7, -1.0, -1.5, -2.0, -2.5, -3.0, -3.5, -4, -5, > > -6, -7.1, -8, -9, -10, -11, -12, -15, -20, -25] > > spec_frequency = [6, 8] > > spec_results = [-3.0, -3.0] > > > > # Plot > > figure = pylab.subplot(111) > > figure.semilogx() > > figure.scatter(test_frequency, test_results, s=20, c='b', marker='s', > > edgecolors='none') > > figure.scatter(spec_frequency, spec_results, s=40, c='g', marker='s', > > edgecolors='none') > > figure.grid(True) > > figure.set_xlabel(r"Frequency (Hz)", fontsize = 12) > > figure.set_ylabel(r"Actuator Response (db)", fontsize = 12) > > > > figure.figure.savefig('log_plot') > > figure.figure.show() > > > > > > Plots a figure on the screen that looks correct, then the following > > error (when I click OK, PythonWin closes) > > > > > > > > Any advice would be appreciated. Maybe it's an installation or setup > > issue, but I'm pretty knew to Python programming and don't know how to > > debug this. > > > > Lee Boger > |
|
From: Christoph G. <cg...@uc...> - 2010-02-09 20:07:12
|
I am not sure what's going on. The script you posted imports pylab in
the first line. It should be defined. The scrit works just fine after
the proposed changes, even from Pythonwin. Did you completely quit
Pythonwin after the crashes and made sure no corrupted python instance
was left running? Please send the version string of your python
installation.
Christoph
On 2/9/2010 11:10 AM, Lee Boger wrote:
>
> Per another suggestion, I did uninstall numpy 1.4 and installed numpy
> 1.3, but got the same results. Using pylab.savefig('log_plot) resulted
> in the following error:
>
> Traceback (most recent call last):
> File "C:\Program Files\Common
> Files\dSPACE\Python25\lib\site-packages\Pythonwin\pywin\framework\scriptutils.py",
> line 310, in RunScript
> exec codeObject in __main__.__dict__
> File "C:\Documents and Settings\BogerLC\My Documents\Script2.py", line
> 20, in <module>
> pylab.savefig('log_plot')
> NameError: name 'pylab' is not defined
>
> Using pyplot.savefig('log_plot') does not have an error, but I still get
> no file saved. Maybe it is a "backend" thing, which I know nothing
> about. I'll look into it. Thanks.
>
> Lee
>
>
> *Christoph Gohlke <cg...@uc...>*
>
> 02/09/2010 02:03 PM
>
>
> To
> matplotlib-users <mat...@li...>
> cc
>
> Subject
> Re: [Matplotlib-users] Runtime Error - Need Advice
>
>
>
>
>
> Caterpillar: Confidential Green Retain Until: 03/11/2010
>
>
>
>
> Use pylab.savefig('log_plot'). Also saving the figure to file and
> showing it interactively in the same script might involve switching
> backends, which might not work as expected.
>
> It is advisable to downgrade to numpy 1.3.
>
> -- Christoph
>
> On 2/9/2010 10:44 AM, Lee Boger wrote:
>>
>> Although, if I close the figure then re-run the script, a new figure
>> pops up but it doesn't have any data plotted. Interpreter is now locked
>> up. I'm still not fixing it completely. There is also no figure stored
>> as a file log_plot.
>>
>> Lee
>>
>>
>> *Christoph Gohlke <cg...@uc...>*
>>
>> 02/09/2010 01:23 PM
>>
>>
>> To
>> Lee Boger <Bog...@ca...>
>> cc
>>
>> Subject
>> Re: [Matplotlib-users] Runtime Error - Need Advice
>>
>>
>>
>>
>>
>> Caterpillar: Confidential Green Retain Until: 03/11/2010
>>
>>
>>
>>
>> Change the last line to pylab.show() and it should work.
>>
>> Anyway, this example should not crash the interpreter. I can reproduce
>> the crash on Python 2.4, 2.5, and 2.6 (32 and 64 bit) on Windows with
>> mpl 0.99.1 but not on Ubuntu 9.1 with mpl 0.99.0.
>>
>> The shortest example that crashes is:
>>
>> python -c "import pylab;pylab.subplot(111).figure.show()"
>>
>> or on the interactive prompt:
>>
>>>>> import pylab
>>>>> pylab.subplot(111).figure.show()
>>>>> exit()
>> 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.
>>
>>
>> -- Christoph
>>
>> On 2/9/2010 7:57 AM, Lee Boger wrote:
>>>
>>> Windows XP Professional with Python 2.5 installed (pywin32 build 210) -
>>> came with dSPACE software package
>>>
>>> Downloaded and installed matplotlib-0.99.1.win32-py2.5.exe from
>>> sourceforge.net
>>>
>>> Downloaded and installed numpy-1.4.0-win32-superpack-python2.5.exe from
>>> sourceforge.net
>>>
>>> Executing the following simple "log plot" script within PythonWin:
>>>
>>> *from* matplotlib *import* pylab
>>>
>>> # Create some artificial data.
>>> test_frequency = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
>>> 17, 18, 19, 20]
>>> test_results = [-0.2, -0.7, -1.0, -1.5, -2.0, -2.5, -3.0, -3.5, -4, -5,
>>> -6, -7.1, -8, -9, -10, -11, -12, -15, -20, -25]
>>> spec_frequency = [6, 8]
>>> spec_results = [-3.0, -3.0]
>>>
>>> # Plot
>>> figure = pylab.subplot(111)
>>> figure.semilogx()
>>> figure.scatter(test_frequency, test_results, s=20, c='b', marker='s',
>>> edgecolors='none')
>>> figure.scatter(spec_frequency, spec_results, s=40, c='g', marker='s',
>>> edgecolors='none')
>>> figure.grid(True)
>>> figure.set_xlabel(r"Frequency (Hz)", fontsize = 12)
>>> figure.set_ylabel(r"Actuator Response (db)", fontsize = 12)
>>>
>>> figure.figure.savefig('log_plot')
>>> figure.figure.show()
>>>
>>>
>>> Plots a figure on the screen that looks correct, then the following
>>> error (when I click OK, PythonWin closes)
>>>
>>>
>>>
>>> Any advice would be appreciated. Maybe it's an installation or setup
>>> issue, but I'm pretty knew to Python programming and don't know how to
>>> debug this.
>>>
>>> Lee Boger
>>>
>>>
>>>
>>>
> ------------------------------------------------------------------------------
>>> The Planet: dedicated and managed hosting, cloud storage, colocation
>>> Stay online with enterprise data centers and the best network in the
>> business
>>> Choose flexible plans and management services without long-term contracts
>>> Personal 24x7 support from experience hosting pros just a phone call away.
>>> http://p.sf.net/sfu/theplanet-com
>>>
>>>
>>>
>>> _______________________________________________
>>> Matplotlib-users mailing list
>>> Mat...@li...
>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>
> ------------------------------------------------------------------------------
> The Planet: dedicated and managed hosting, cloud storage, colocation
> Stay online with enterprise data centers and the best network in the
> business
> Choose flexible plans and management services without long-term contracts
> Personal 24x7 support from experience hosting pros just a phone call away.
> http://p.sf.net/sfu/theplanet-com
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
|
|
From: Lee B. <Bog...@ca...> - 2010-02-09 19:53:58
|
Thanks for your help. I'll look into ipython. Lee Eric Firing <ef...@ha...> 02/09/2010 02:31 PM To Lee Boger <Bog...@ca...>, matplotlib-users <mat...@li...> cc Subject Re: [Matplotlib-users] Runtime Error - Need Advice Caterpillar: Confidential Green Retain Until: 03/11/2010 Lee Boger wrote: > > Thanks for the quick feedback. I changed the last line from > figure.figure.show() to pyplot.show() and it worked without crashing the > interpreter. However, if I close the figure then re-run the script, a > new figure pops up but it doesn't have any data plotted. Interpreter is > now locked up, the run-time error occurred and no figure stored as a > file log_plot. I un-installed numpy-1.4.0 and installed numpy-1.3.0, but > the results were as I just described. > > Lee > At this point a Windows user may need to step in. I know nothing about PythonWin. My suspicion is that this is a problem of dueling event loops, and one solution would be to use ipython instead of pythonwin. (Note that you typically need to use "reply to all" on this list, otherwise the reply does not get copied to the list.) Eric > > > *Eric Firing <ef...@ha...>* > > 02/09/2010 01:35 PM > > > To > Lee Boger <Bog...@ca...> > cc > mat...@li... > Subject > Re: [Matplotlib-users] Runtime Error - Need Advice > > > > > > Caterpillar: Confidential Green Retain Until: 03/11/2010 > > > > > Lee Boger wrote: > > > > Windows XP Professional with Python 2.5 installed (pywin32 build 210) - > > came with dSPACE software package > > > > Downloaded and installed matplotlib-0.99.1.win32-py2.5.exe from > > sourceforge.net > > > > Downloaded and installed numpy-1.4.0-win32-superpack-python2.5.exe from > > sourceforge.net > > I suspect this is the problem: numpy-1.4.0 is considered broken and has > been withdrawn. Specifically, it introduces binary incompatibility with > programs compiled against prior versions of numpy, including matplotlib. > If you go back to the numpy sourceforge site now, I think you will see > an earlier version that you can install in place of 1.4.0 (after > removing the latter). > > Eric > > > > > Executing the following simple "log plot" script within PythonWin: > > > > *from* matplotlib *import* pylab > > > > # Create some artificial data. > > test_frequency = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, > > 17, 18, 19, 20] > > test_results = [-0.2, -0.7, -1.0, -1.5, -2.0, -2.5, -3.0, -3.5, -4, -5, > > -6, -7.1, -8, -9, -10, -11, -12, -15, -20, -25] > > spec_frequency = [6, 8] > > spec_results = [-3.0, -3.0] > > > > # Plot > > figure = pylab.subplot(111) > > figure.semilogx() > > figure.scatter(test_frequency, test_results, s=20, c='b', marker='s', > > edgecolors='none') > > figure.scatter(spec_frequency, spec_results, s=40, c='g', marker='s', > > edgecolors='none') > > figure.grid(True) > > figure.set_xlabel(r"Frequency (Hz)", fontsize = 12) > > figure.set_ylabel(r"Actuator Response (db)", fontsize = 12) > > > > figure.figure.savefig('log_plot') > > figure.figure.show() > > > > > > Plots a figure on the screen that looks correct, then the following > > error (when I click OK, PythonWin closes) > > > > > > > > Any advice would be appreciated. Maybe it's an installation or setup > > issue, but I'm pretty knew to Python programming and don't know how to > > debug this. > > > > Lee Boger > |
|
From: Eric F. <ef...@ha...> - 2010-02-09 19:31:22
|
Lee Boger wrote: > > Thanks for the quick feedback. I changed the last line from > figure.figure.show() to pyplot.show() and it worked without crashing the > interpreter. However, if I close the figure then re-run the script, a > new figure pops up but it doesn't have any data plotted. Interpreter is > now locked up, the run-time error occurred and no figure stored as a > file log_plot. I un-installed numpy-1.4.0 and installed numpy-1.3.0, but > the results were as I just described. > > Lee > At this point a Windows user may need to step in. I know nothing about PythonWin. My suspicion is that this is a problem of dueling event loops, and one solution would be to use ipython instead of pythonwin. (Note that you typically need to use "reply to all" on this list, otherwise the reply does not get copied to the list.) Eric > > > *Eric Firing <ef...@ha...>* > > 02/09/2010 01:35 PM > > > To > Lee Boger <Bog...@ca...> > cc > mat...@li... > Subject > Re: [Matplotlib-users] Runtime Error - Need Advice > > > > > > Caterpillar: Confidential Green Retain Until: 03/11/2010 > > > > > Lee Boger wrote: > > > > Windows XP Professional with Python 2.5 installed (pywin32 build 210) - > > came with dSPACE software package > > > > Downloaded and installed matplotlib-0.99.1.win32-py2.5.exe from > > sourceforge.net > > > > Downloaded and installed numpy-1.4.0-win32-superpack-python2.5.exe from > > sourceforge.net > > I suspect this is the problem: numpy-1.4.0 is considered broken and has > been withdrawn. Specifically, it introduces binary incompatibility with > programs compiled against prior versions of numpy, including matplotlib. > If you go back to the numpy sourceforge site now, I think you will see > an earlier version that you can install in place of 1.4.0 (after > removing the latter). > > Eric > > > > > Executing the following simple "log plot" script within PythonWin: > > > > *from* matplotlib *import* pylab > > > > # Create some artificial data. > > test_frequency = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, > > 17, 18, 19, 20] > > test_results = [-0.2, -0.7, -1.0, -1.5, -2.0, -2.5, -3.0, -3.5, -4, -5, > > -6, -7.1, -8, -9, -10, -11, -12, -15, -20, -25] > > spec_frequency = [6, 8] > > spec_results = [-3.0, -3.0] > > > > # Plot > > figure = pylab.subplot(111) > > figure.semilogx() > > figure.scatter(test_frequency, test_results, s=20, c='b', marker='s', > > edgecolors='none') > > figure.scatter(spec_frequency, spec_results, s=40, c='g', marker='s', > > edgecolors='none') > > figure.grid(True) > > figure.set_xlabel(r"Frequency (Hz)", fontsize = 12) > > figure.set_ylabel(r"Actuator Response (db)", fontsize = 12) > > > > figure.figure.savefig('log_plot') > > figure.figure.show() > > > > > > Plots a figure on the screen that looks correct, then the following > > error (when I click OK, PythonWin closes) > > > > > > > > Any advice would be appreciated. Maybe it's an installation or setup > > issue, but I'm pretty knew to Python programming and don't know how to > > debug this. > > > > Lee Boger > |
|
From: Christoph G. <cg...@uc...> - 2010-02-09 19:02:07
|
Use pylab.savefig('log_plot'). Also saving the figure to file and
showing it interactively in the same script might involve switching
backends, which might not work as expected.
It is advisable to downgrade to numpy 1.3.
-- Christoph
On 2/9/2010 10:44 AM, Lee Boger wrote:
>
> Although, if I close the figure then re-run the script, a new figure
> pops up but it doesn't have any data plotted. Interpreter is now locked
> up. I'm still not fixing it completely. There is also no figure stored
> as a file log_plot.
>
> Lee
>
>
> *Christoph Gohlke <cg...@uc...>*
>
> 02/09/2010 01:23 PM
>
>
> To
> Lee Boger <Bog...@ca...>
> cc
>
> Subject
> Re: [Matplotlib-users] Runtime Error - Need Advice
>
>
>
>
>
> Caterpillar: Confidential Green Retain Until: 03/11/2010
>
>
>
>
> Change the last line to pylab.show() and it should work.
>
> Anyway, this example should not crash the interpreter. I can reproduce
> the crash on Python 2.4, 2.5, and 2.6 (32 and 64 bit) on Windows with
> mpl 0.99.1 but not on Ubuntu 9.1 with mpl 0.99.0.
>
> The shortest example that crashes is:
>
> python -c "import pylab;pylab.subplot(111).figure.show()"
>
> or on the interactive prompt:
>
>>>> import pylab
>>>> pylab.subplot(111).figure.show()
>>>> exit()
> 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.
>
>
> -- Christoph
>
> On 2/9/2010 7:57 AM, Lee Boger wrote:
>>
>> Windows XP Professional with Python 2.5 installed (pywin32 build 210) -
>> came with dSPACE software package
>>
>> Downloaded and installed matplotlib-0.99.1.win32-py2.5.exe from
>> sourceforge.net
>>
>> Downloaded and installed numpy-1.4.0-win32-superpack-python2.5.exe from
>> sourceforge.net
>>
>> Executing the following simple "log plot" script within PythonWin:
>>
>> *from* matplotlib *import* pylab
>>
>> # Create some artificial data.
>> test_frequency = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
>> 17, 18, 19, 20]
>> test_results = [-0.2, -0.7, -1.0, -1.5, -2.0, -2.5, -3.0, -3.5, -4, -5,
>> -6, -7.1, -8, -9, -10, -11, -12, -15, -20, -25]
>> spec_frequency = [6, 8]
>> spec_results = [-3.0, -3.0]
>>
>> # Plot
>> figure = pylab.subplot(111)
>> figure.semilogx()
>> figure.scatter(test_frequency, test_results, s=20, c='b', marker='s',
>> edgecolors='none')
>> figure.scatter(spec_frequency, spec_results, s=40, c='g', marker='s',
>> edgecolors='none')
>> figure.grid(True)
>> figure.set_xlabel(r"Frequency (Hz)", fontsize = 12)
>> figure.set_ylabel(r"Actuator Response (db)", fontsize = 12)
>>
>> figure.figure.savefig('log_plot')
>> figure.figure.show()
>>
>>
>> Plots a figure on the screen that looks correct, then the following
>> error (when I click OK, PythonWin closes)
>>
>>
>>
>> Any advice would be appreciated. Maybe it's an installation or setup
>> issue, but I'm pretty knew to Python programming and don't know how to
>> debug this.
>>
>> Lee Boger
>>
>>
>>
>> ------------------------------------------------------------------------------
>> The Planet: dedicated and managed hosting, cloud storage, colocation
>> Stay online with enterprise data centers and the best network in the
> business
>> Choose flexible plans and management services without long-term contracts
>> Personal 24x7 support from experience hosting pros just a phone call away.
>> http://p.sf.net/sfu/theplanet-com
>>
>>
>>
>> _______________________________________________
>> Matplotlib-users mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
|
|
From: Eric F. <ef...@ha...> - 2010-02-09 18:35:13
|
Lee Boger wrote: > > Windows XP Professional with Python 2.5 installed (pywin32 build 210) - > came with dSPACE software package > > Downloaded and installed matplotlib-0.99.1.win32-py2.5.exe from > sourceforge.net > > Downloaded and installed numpy-1.4.0-win32-superpack-python2.5.exe from > sourceforge.net I suspect this is the problem: numpy-1.4.0 is considered broken and has been withdrawn. Specifically, it introduces binary incompatibility with programs compiled against prior versions of numpy, including matplotlib. If you go back to the numpy sourceforge site now, I think you will see an earlier version that you can install in place of 1.4.0 (after removing the latter). Eric > > Executing the following simple "log plot" script within PythonWin: > > *from* matplotlib *import* pylab > > # Create some artificial data. > test_frequency = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, > 17, 18, 19, 20] > test_results = [-0.2, -0.7, -1.0, -1.5, -2.0, -2.5, -3.0, -3.5, -4, -5, > -6, -7.1, -8, -9, -10, -11, -12, -15, -20, -25] > spec_frequency = [6, 8] > spec_results = [-3.0, -3.0] > > # Plot > figure = pylab.subplot(111) > figure.semilogx() > figure.scatter(test_frequency, test_results, s=20, c='b', marker='s', > edgecolors='none') > figure.scatter(spec_frequency, spec_results, s=40, c='g', marker='s', > edgecolors='none') > figure.grid(True) > figure.set_xlabel(r"Frequency (Hz)", fontsize = 12) > figure.set_ylabel(r"Actuator Response (db)", fontsize = 12) > > figure.figure.savefig('log_plot') > figure.figure.show() > > > Plots a figure on the screen that looks correct, then the following > error (when I click OK, PythonWin closes) > > > > Any advice would be appreciated. Maybe it's an installation or setup > issue, but I'm pretty knew to Python programming and don't know how to > debug this. > > Lee Boger |
|
From: Christoph G. <cg...@uc...> - 2010-02-09 18:26:18
|
Change the last line to pylab.show() and it should work. Anyway, this example should not crash the interpreter. I can reproduce the crash on Python 2.4, 2.5, and 2.6 (32 and 64 bit) on Windows with mpl 0.99.1 but not on Ubuntu 9.1 with mpl 0.99.0. The shortest example that crashes is: python -c "import pylab;pylab.subplot(111).figure.show()" or on the interactive prompt: >>> import pylab >>> pylab.subplot(111).figure.show() >>> exit() 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. -- Christoph On 2/9/2010 7:57 AM, Lee Boger wrote: > > > > Windows XP Professional with Python 2.5 installed (pywin32 build 210) - > > came with dSPACE software package > > > > Downloaded and installed matplotlib-0.99.1.win32-py2.5.exe from > > sourceforge.net > > > > Downloaded and installed numpy-1.4.0-win32-superpack-python2.5.exe from > > sourceforge.net > > > > Executing the following simple "log plot" script within PythonWin: > > > > *from* matplotlib *import* pylab > > > > # Create some artificial data. > > test_frequency = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, > > 17, 18, 19, 20] > > test_results = [-0.2, -0.7, -1.0, -1.5, -2.0, -2.5, -3.0, -3.5, -4, -5, > > -6, -7.1, -8, -9, -10, -11, -12, -15, -20, -25] > > spec_frequency = [6, 8] > > spec_results = [-3.0, -3.0] > > > > # Plot > > figure = pylab.subplot(111) > > figure.semilogx() > > figure.scatter(test_frequency, test_results, s=20, c='b', marker='s', > > edgecolors='none') > > figure.scatter(spec_frequency, spec_results, s=40, c='g', marker='s', > > edgecolors='none') > > figure.grid(True) > > figure.set_xlabel(r"Frequency (Hz)", fontsize = 12) > > figure.set_ylabel(r"Actuator Response (db)", fontsize = 12) > > > > figure.figure.savefig('log_plot') > > figure.figure.show() > > > > > > Plots a figure on the screen that looks correct, then the following > > error (when I click OK, PythonWin closes) > > > > > > > > Any advice would be appreciated. Maybe it's an installation or setup > > issue, but I'm pretty knew to Python programming and don't know how to > > debug this. > > > > Lee Boger |
|
From: Wayne W. <sie...@sb...> - 2010-02-09 18:22:16
|
Thanks. Completely missed it. (P.S. Reply All +corrected mail filter.) On 2/9/2010 8:18 AM, John Hunter wrote: > On Tue, Feb 9, 2010 at 10:06 AM, Wayne Watson > <sie...@sb...> wrote: > >> I'm sure not making much progress on understanding show(). When used in >> XP in IDLE or by file execution (click on file name), it seems to tie up >> the executing program. In IDLE, the shell window stops and one must >> ... > http://matplotlib.sourceforge.net/users/shell.html > > We recommend using ipython in pylab model when working interactively > because it is designed to make the correct interactive settings and > override "show" to be non-blocking. You can obtain the right results > in matplotlib using Idle if you are careful, but for "just works out > of the box" ipython in pylab mode will be easier. > > JDH > > -- "Crime is way down. War is declining. And that's far from the good news." -- Steven Pinker (and other sources) Why is this true, but yet the media says otherwise? The media knows very well how to manipulate us (see limbic, emotion, $$). -- WTW |
|
From: John H. <jd...@gm...> - 2010-02-09 17:53:10
|
On Tue, Feb 9, 2010 at 11:36 AM, Wayne Watson <sie...@sb...> wrote: > Thanks for the clarification. I'm really new to this, and do not know of > interactive mode. I presume there's a command to turn it off and on, and > possibly an example on how to do it. Is this method of operation with > show() mentioned anywhere? Yes, on the documentation link I referred you to. JDH |
|
From: Wayne W. <sie...@sb...> - 2010-02-09 17:37:36
|
Thanks. I'll consider it. See my post to John Hunter moments ago as to
why I "must" use IDLE. Basically, the users are not at all familiar with
Python, and historically the us has been that way for 3-4 years.
On 2/9/2010 8:20 AM, Ben Axelrod wrote:
> Maybe instead of plot.show() you should do something like:
>
> plot.draw()
> raw_input('Press ENTER to exit')
>
> Personally, I also use IDLE on Windows XP to edit my matplotlib files. However, I never execute in IDLE. I simply double click the file in windows explorer.
>
> -Ben
>
> -----Original Message-----
> From: Wayne Watson [mailto:sie...@sb...]
> Sent: Tuesday, February 09, 2010 11:07 AM
> To: mat...@li...
> Subject: [Matplotlib-users] Verifying the Use of show()? Win XP
>
> I'm sure not making much progress on understanding show(). When used in XP in IDLE or by file execution (click on file name), it seems to tie up the executing program. In IDLE, the shell window stops and one must exit the window.
>
> I'd appreciate it if someone could take any examples from<http://matplotlib.sourceforge.net/index.html> and try to execute them as in the first paragraph to see if they terminate successfully.Let me know what OS used, hopefully XP, and if you used IDLE or file execution.
> I suspect you will find every example there ends with show(). Try putting a print statement after show() you've done it with the show() the last line.
> --
> "Crime is way down. War is declining. And that's far from the good news." -- Steven Pinker (and other sources) Why is this true, but yet the media says otherwise? The media knows very well how to manipulate us (see limbic, emotion, $$). -- WTW
>
> ------------------------------------------------------------------------------
> The Planet: dedicated and managed hosting, cloud storage, colocation Stay online with enterprise data centers and the best network in the business Choose flexible plans and management services without long-term contracts Personal 24x7 support from experience hosting pros just a phone call away.
> http://p.sf.net/sfu/theplanet-com
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
--
"Crime is way down. War is declining. And that's far from the good
news." -- Steven Pinker (and other sources) Why is this true, but yet
the media says otherwise? The media knows very well how to manipulate us
(see limbic, emotion, $$). -- WTW
|
|
From: Wayne W. <sie...@sb...> - 2010-02-09 17:36:44
|
Thanks for the clarification. I'm really new to this, and do not know of interactive mode. I presume there's a command to turn it off and on, and possibly an example on how to do it. Is this method of operation with show() mentioned anywhere? The unfortunate present use of show() is that it ties up the shell script, where I happened to have written program output. It's handy to put it there, since it's meant to be interactive. The user is keyboard arrowing through images, and statistical data is placed on the shell window. At the same time he sees a plot of data relevant to the image. He needs to close the plot window before going to the next image. I can probably figure out how to kill the plot window when he does that. My problem with using ipython is that the program I'm modifying is used with IDLE, and people have gotten to use it that way. I had nothing to do with that method of op. I doubt any of the users would be agreeable to using ipython. None of them know Python. The next time the program is released, I may provide it in executable form. I used matlab five years ago, for about two months. To see if it could help me understand MPL, I fired it up, and it's now working. Perhaps the interactive op is explained there. I take it there is no show() there? Interesting mention of "non-blocking". In the midst of this dilemma, I started getting socket errors. Using McAffe I found pythonw as blocked. Would that be in anyway associated with the use of show()? I've since changed it to outbound blocking. On 2/9/2010 8:18 AM, John Hunter wrote: > On Tue, Feb 9, 2010 at 10:06 AM, Wayne Watson > <sie...@sb...> wrote: > ... >> the last line. >> > "show" is meant to start the GUI mainloop, which is usually blocking, > and raise all windows, so the behavior you are reporting is the > intended behavior. When working interactively, as in Idle, you > shouldn't need to use show if you turn interactive mode on. > > http://matplotlib.sourceforge.net/users/shell.html > > We recommend using ipython in pylab model when working interactively > because it is designed to make the correct interactive settings and > override "show" to be non-blocking. You can obtain the right results > in matplotlib using Idle if you are careful, but for "just works out > of the box" ipython in pylab mode will be easier. > > JDH > > -- "Crime is way down. War is declining. And that's far from the good news." -- Steven Pinker (and other sources) Why is this true, but yet the media says otherwise? The media knows very well how to manipulate us (see limbic, emotion, $$). -- WTW |
|
From: Jae-Joon L. <lee...@gm...> - 2010-02-09 17:03:49
|
Copying a matplotlib canvas (or a figure, or an axes) is not easy. You cannot just rebind it. You need to copy all the hierarchy of underlying artists. Also the attributes of artists need to be adjusted accordingly. And best option in my opinion is just to create another canvas using the code that created the original canvas. Regards, -JJ On Mon, Feb 8, 2010 at 3:04 PM, <Dav...@se...> wrote: > Hey folks, > > my problem may be obvious, but i can't seem to copy a plot from one canvas > to another. > > # I have this object where whichCanvas is an instance of MplWidget (code > shown below) > > self.whichCanvas.canvas.ax.plot(xData, yData, 'bo', linewidth=1.5, > linestyle='-') > > > > > # I want to copy the plot and axes to another MplWidget object > > self.anotherCanvas.canvas > > > > I've tried: > > self.anotherCanvas.canvas.ax = self.whichCanvas.canvas.ax > self.anotherCanvas.canvas.draw() > > and > > self.anotherCanvas.canvas = self.whichCanvas.canvas > self.anotherCanvas.canvas.draw() > > the plot doesn't seem to copy. Does any body more familiar with matplotlib > have any suggestions? > > > > > > This is the MplWidget Class > ***************************** MplWidget ******************************* > > from PyQt4 import QtGui > from matplotlib.backends.backend_qt4agg \ > import FigureCanvasQTAgg as FigureCanvas > from matplotlib.figure import Figure > > > > > class MplCanvas(FigureCanvas): > def __init__(self): > self.fig = Figure() > self.ax = self.fig.add_subplot(111) > FigureCanvas.__init__(self, self.fig) > FigureCanvas.setSizePolicy(self, > QtGui.QSizePolicy.Expanding, > QtGui.QSizePolicy.Expanding) > FigureCanvas.updateGeometry(self) > > > > > class MplWidget(QtGui.QWidget): > > def __init__(self, parent = None): > QtGui.QWidget.__init__(self, parent) > self.canvas = MplCanvas() > self.vbl = QtGui.QVBoxLayout() > self.vbl.addWidget(self.canvas) > self.setLayout(self.vbl) > > > > Regards, > Dave Tung > > cell: 925-321-6657 > office: 510-353-4770 > dav...@se... > > ------------------------------------------------------------------------------ > The Planet: dedicated and managed hosting, cloud storage, colocation > Stay online with enterprise data centers and the best network in the > business > Choose flexible plans and management services without long-term contracts > Personal 24x7 support from experience hosting pros just a phone call away. > http://p.sf.net/sfu/theplanet-com > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > |
|
From: Jae-Joon L. <lee...@gm...> - 2010-02-09 16:51:43
|
Figure.draw_artist is just a convenience function.
def draw_artist(self, a):
"""
draw :class:`matplotlib.artist.Artist` instance *a* only --
this is available only after the figure is drawn
"""
assert self._cachedRenderer is not None
a.draw(self._cachedRenderer)
And, all the drawing is done by the artist itself.
>
> Also, other atists don't fail in this manner if I don't use artist.set_figure().
>
As far as I can see, it only means that you're lucky with other artists.
The reason Text artists needs a reference to the figure is to access
the dpi value, as the exception indicates.
All artists are meant to be added to an axes (or at least "axes",
"figure", etc. attributes set appropriately) to work correctly.
Regards,
-JJ
|