how to configure to plot in windows

Asked by ccanepa

I have python 2.6.5 installed in my system ( windows xp sp3 32 bits )

I installed dreampie from the exe installer, dreampie-1.1-setup.exe

later, I installed matplotlib from the binary installer matplotlib-1.0.0.win32-py2.6.exe ;

it offered to install to my 2.6 python, in c:\python26, I tell yes, installation proceed normally and from the stock python 2.6 interpreter a quick test worked ok.

starting dreampie and doing
from pylab import *

produced the warning 'Warning: matplotlib in non-interactive mode detected...'
a simple test x = randn(10000); hist(x, 100) and later issuing a show() in fact showed the Tk window with the histogram.

How to enable the interactive mode ?

interactive : True
in matplotlibrc , starting dreampie and importing pylab as before made the console unresponsive, by example typing 'a=1' produces nothing.

closed dreampie, tried changing the backend in matplotlibrc: the original was
backend : TkAgg
I tried the backends GTK GTKAgg GTKCairo
All of those gave a matplotlib traceback complaining that no gtk is present.

I suppose that matplotlib can't reach to the gtk stuff in the dreampie installation directory.

Any suggestion to enable the interactive mode ?

Question information

English Edit question
DreamPie Edit question
No assignee Edit question
Solved by:
Last query:
Last reply:
Revision history for this message
Noam Yorav-Raphael (noamraph) said :

Thanks for trying DreamPie!

You're right about the PyGTK DreamPie uses - for simplicity, it's
private to DreamPie and doesn't go through to the underlying
interpreter. But Tkinter mode should work fine, so it seems like a

Does DreamPie simply stop responding after you do "from pylab import
*" in interactive mode?
Does it still work fine if you set Interactive: False? (If it does, in
the meanwhile you can run "ion()" to temporarily start interactive
Can you check if the interactive mode works in the regular Python shell?


Revision history for this message
ccanepa (ccanepacc) said :

Thanks for your fast reply, Noam.

I think you can file the question under 'operation failure'.
What I was missing is that dreampie enters in a 'multiline mode' if it sees trailing blanks, thus needing a ctrl + enter to execute. That gives me the impression that something hanged.
( I was coping and pasted from a matplotlib example, and a space got caught in the process. Maybe the windows arrangement on screen made the status bar in Dreampie be hidden under the windows taskbar at first )

Just FYI, the interactive mode seems to work ok setting

interactive : True
in the matplotlibrc

and letting the backend line untouched, that is
backend : TkAgg

About multiline feedback:
At least for beginners with Dreampie it can take some time to know about this multiline mode, because the feedback in the status bar ( Tip: to execute your code you may need to press enter) shows only after entering *two* blank lines.
'a=1 <enter>' -> no tip, notice the space before <enter>
'b=1<enter>' -> no tip
'<enter> -> no tip
'<enter> -> tip, but will disappear in k seconds, also disappears if a key is pressed
'c=1<enter>' -> no tip

A more instant and persistent warning would be useful, maybe one of the following:

a) in the interpreter output window print at the moment Dreampie goes multiline
    '[ waiting for end multiline entry: ctrl + return ]'

b) show in some place of status bar the tip, starting at the first enter that goes multiline. And don't erase it while multiline mode is active.

Revision history for this message
Noam Yorav-Raphael (noamraph) said :

I'm glad it worked. Thanks for your suggestions!

For now I'll leave the current behavior - it seems to me that you were
especially unlucky (a combination of using copy-paste for the first
commands, having the status bar hidden and beeps turned off.) If this
happens to more people I will consider this again - I just don't want
to distract too much when people are already aware if this behavior.