SourceForge logo
SourceForge logo
Menu

matplotlib-users

From: Emin.shopper Martinian.s. <emi...@gm...> - 2006年11月16日 14:13:03
Whenever I try to use matplotlib from a python session inside emacs, python
freezes. What I do is start GNU Emacs version 21.1.3 for Windows, do ESC-x
shell and enter the commands shown below. Note that I set the backend to PS
and interactive to false, but my python interpreter still freezes. I suspect
that this is because matplotlib is generating some GUI events which upset
emacs. The example works fine if I run python through the shell without
emacs, but I would very much like to run python through an emacs session.
Similar problems happen with other backends. Any suggestions on how to solve
this problem would be much appreciated.
Thanks,
-Emin
-------- Transcript of session follows
--------------------------------------------------
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\>c:\python25\python.exe -i
c:\python25\python.exe -i
Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit (Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
>>> print numpy.__version__
1.0
>>> import matplotlib, pylab
>>> matplotlib.interactive(False)
>>> matplotlib.use('PS')
>>> def example(size):
... pylab.hist(range(size))
... print 'made hist of size %i' % size
... return size
...
>>> print [example(i) for i in range(10,20)]
made hist of size 10
made hist of size 11
made hist of size 12
made hist of size 13
made hist of size 14
made hist of size 15
made hist of size 16
made hist of size 17
made hist of size 18
made hist of size 19
[10, 11, 12, 13, 14, 15, 16, 17, 18, 19]
>>>
python is now frozen
From: Nicolas G. <nic...@ga...> - 2006年11月27日 17:23:00
I'm not sure, but I guess you should make
matplotlib.interactive(False) and matplotlib.use('PS') BEFORE
importing pylab.
Nicolas Grilly
On 11/16/06, Emin.shopper Martinian.shopper <emi...@gm...> wrote:
> Whenever I try to use matplotlib from a python session inside emacs, python
> freezes. What I do is start GNU Emacs version 21.1.3 for Windows, do ESC-x
> shell and enter the commands shown below. Note that I set the backend to PS
> and interactive to false, but my python interpreter still freezes. I suspect
> that this is because matplotlib is generating some GUI events which upset
> emacs. The example works fine if I run python through the shell without
> emacs, but I would very much like to run python through an emacs session.
> Similar problems happen with other backends. Any suggestions on how to solve
> this problem would be much appreciated.
From: Emin.shopper Martinian.s. <emi...@gm...> - 2006年12月01日 14:51:41
Dear Nicolas,
Thank you very much for your suggestion. I can now use matplotlib and pylab
in non-interactive mode in emacs, which makes me very happy.
The only thing that would make me even happier is if I could use
matplotlib/pylab in interative mode through emacs :). That's probably a
longer term issue, though.
Thanks again,
-Emin
On 11/27/06, Nicolas Grilly <nic...@ga...> wrote:
>
> I'm not sure, but I guess you should make
> matplotlib.interactive(False) and matplotlib.use('PS') BEFORE
> importing pylab.
>
> Nicolas Grilly
>
> On 11/16/06, Emin.shopper Martinian.shopper <emi...@gm...>
> wrote:
> > Whenever I try to use matplotlib from a python session inside emacs,
> python
> > freezes. What I do is start GNU Emacs version 21.1.3 for Windows, do
> ESC-x
> > shell and enter the commands shown below. Note that I set the backend to
> PS
> > and interactive to false, but my python interpreter still freezes. I
> suspect
> > that this is because matplotlib is generating some GUI events which
> upset
> > emacs. The example works fine if I run python through the shell without
> > emacs, but I would very much like to run python through an emacs
> session.
> > Similar problems happen with other backends. Any suggestions on how to
> solve
> > this problem would be much appreciated.
>
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /