Christoph Gohlke | 9 Feb 22:35
Picon
Favicon

Re: Runtime Error - Need Advice

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 <cgohlke@...>* > > 02/09/2010 01:23 PM > > > To > Lee Boger <Boger_Lee@...> > 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 >> Matplotlib-users@... >> 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
(Continue reading)

Christoph Gohlke | 9 Feb 21:07
Picon
Favicon

Re: Runtime Error - Need Advice

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 <cgohlke@...>* > > 02/09/2010 02:03 PM > > > To > matplotlib-users <matplotlib-users@...> > 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 <cgohlke@...>* >> >> 02/09/2010 01:23 PM >> >> >> To >> Lee Boger <Boger_Lee@...> >> 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 >>> Matplotlib-users@... >>> 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 > Matplotlib-users@... > 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
(Continue reading)

Eric Firing | 9 Feb 20:30
Favicon

Re: Runtime Error - Need Advice

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 <efiring@...>*
> 
> 02/09/2010 01:35 PM
> 
> 	
> To
> 	Lee Boger <Boger_Lee@...>
> cc
> 	matplotlib-users@...
> 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
> 

------------------------------------------------------------------------------
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
(Continue reading)

Christoph Gohlke | 9 Feb 20:02
Picon
Favicon

Re: Runtime Error - Need Advice

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 <cgohlke@...>* > > 02/09/2010 01:23 PM > > > To > Lee Boger <Boger_Lee@...> > 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 >> Matplotlib-users@... >> 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
(Continue reading)

Nick Schurch | 9 Feb 17:38
Picon
Favicon

his problems...

HI all,

I've been using matplotlip for a while now but mainly for line plots,
scatter plots and the odd dendrogram. I recently tried plotting a
histogram (of a binomial function) and encountered a problem. So I
though I'd try the extremely simple example set on the front of the
matplotlib page.... and heres what I got:

Python 2.4.3 (#1, Sep  3 2009, 15:37:12)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-46)] on linux2
Type "help", "copyright", "credits" or "license" for more information.

>>> from pylab import randn, hist >>> x = randn(10000) >>> hist(x, 100)
Traceback (most recent call last): File "<stdin>", line 1, in ? File "/usr/lib/python2.4/site-packages/matplotlib/pyplot.py", line 1633, in hist ret = gca().hist(*args, **kwargs) File "/usr/lib/python2.4/site-packages/matplotlib/axes.py", line 5060, in hist align=align, log=log) File "/usr/lib/python2.4/site-packages/matplotlib/axes.py", line 3253, in bar assert len(height)==nbars, "argument 'height' must be %d or scalar" % nbars AssertionError: argument 'height' must be 101 or scalar Any idea why this isn't working? I have matplotlib v0.91.2 - will updating to 0.99 solve the problem? -- -- Cheers, Nick Schurch ------------------------------------------------------------------------------
(Continue reading)

Lee Boger | 9 Feb 16:57
Favicon

Runtime Error - Need Advice


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
Matplotlib-users@...
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Wayne Watson | 9 Feb 17:06
Picon
Favicon

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
Tomasz Koziara | 8 Feb 21:26
Picon
Picon

hatching problem

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

===================
Attachment (cubes_1_PSEUDO_RIGID_FULL): application/octet-stream, 2027 bytes

Attachment (plots.py): text/x-python-script, 1431 bytes

===================

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
Matplotlib-users@...
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Ben Axelrod | 8 Feb 22:24
Favicon

Figure.draw_artist() bug with Text

I am getting a fault when I try to use Figure.draw_artist() with a matplotlib.text.Text object.  Since
matplotlib.text.Text inherits from matplotlib.artist.Artist, which is what draw_artist() takes,
this should probably work.

Tested with latest SVN code on Linux.

Here is the traceback:

Traceback (most recent call last):
  File "test.py", line 10, in <module>
    fig.draw_artist(textartist)
  File "/usr/local/lib/python2.6/site-packages/matplotlib/figure.py", line 816, in draw_artist
    a.draw(self._cachedRenderer)
  File "/usr/local/lib/python2.6/site-packages/matplotlib/artist.py", line 55, in draw_wrapper
    draw(artist, renderer, *kl)
  File "/usr/local/lib/python2.6/site-packages/matplotlib/text.py", line 549, in draw
    bbox, info = self._get_layout(renderer)
  File "/usr/local/lib/python2.6/site-packages/matplotlib/text.py", line 267, in _get_layout
    key = self.get_prop_tup()
  File "/usr/local/lib/python2.6/site-packages/matplotlib/text.py", line 716, in get_prop_tup
    self.figure.dpi, id(self._renderer),
AttributeError: 'NoneType' object has no attribute 'dpi'

And here is some simple code to trigger the bug:

#!/usr/bin/env python
# display bug in figure.draw_artist(matplotlib.text)
import matplotlib.pyplot as plt
from matplotlib.text import Text

fig = plt.figure()
plt.draw()

textartist = Text(0.5, 0.5, "Foo")
fig.draw_artist(textartist)

plt.show()
#end code

Note that I still get the bug even when i specify figsize and dpi on the figure like so:
fig = plt.figure(figsize=(2,2), dpi=300)

-Ben
------------------------------------------------------------------------------
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
Dave.M.Tung | 8 Feb 21:04
Picon
Favicon

trying to Copy plot from one MplWidget canvas to another

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
dave.m.tung-ShLqkCeKS0lBDgjK7y7TUQ@public.gmane.org

------------------------------------------------------------------------------
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
Matplotlib-users@...
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
C M | 8 Feb 20:49
Picon

help with view_limits

I'd like to set the ticks on the y axis such that they do not display
anything lower than 0, even if part of the graph below 0 is visible.
I tried to do this with

ylocator = AutoLocator()
ylocator.view_limits(0, 100)
self.subplot.yaxis.set_major_locator(ylocator)

but it is not changing anything.  How can I do this?

Thank you,
Che

------------------------------------------------------------------------------
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

Gmane