Is there a better interactive plotter then pylab?

Discussion in 'Python' started by Charles Krug, Apr 28, 2005.

  1. Charles Krug

    Charles Krug Guest

    List:

    I'm trying to us pylab to see what I'm doing with some DSP algorithms,
    in case my posts about convolution and ffts weren't giving it away.

    I've been using pylab's plot function, but I'm finding it a bit
    cumbersome.

    It works, but if I switch from the interactive window to the plot window
    and back, the plot window gets trashed.

    Is there a better alternative for interactive use?

    Thanks


    Charles
     
    Charles Krug, Apr 28, 2005
    #1
    1. Advertising

  2. Charles Krug

    John Hunter Guest

    >>>>> "Charles" == Charles Krug <> writes:

    Charles> List: I'm trying to us pylab to see what I'm doing with
    Charles> some DSP algorithms, in case my posts about convolution
    Charles> and ffts weren't giving it away.

    Charles> I've been using pylab's plot function, but I'm finding it
    Charles> a bit cumbersome.

    Charles> It works, but if I switch from the interactive window to
    Charles> the plot window and back, the plot window gets trashed.

    Charles> Is there a better alternative for interactive use?

    You are probably not using pylab interactive mode properly.
    matplotlib has several GUI backends (gtk, tk, qt, etc...). Most GUIs
    take control with their mainloop and prevent further interaction.
    >From what you describe, I'm pretty sure you haven't setup your

    configuration properly for interactive use. Fortunately, there are a
    couple of solutions.

    For the standard python shell, you need to use the TkAgg backend.
    Tkinter is the only python GUI that plays nicely with the standard
    python shell. You will need to set "backend : TkAgg" and
    "interactive : True" in the matplotlib rc file. See
    http://matplotlib.sf.net/interactive.html for details and
    http://matplotlib.sf.net/.matplotlibrc for information on the
    configuration file.

    If you want to use another GUI backend, eg GTKAgg (the default on
    linux and also the fastest backend), you need to use a custom python
    interpreter which runs the GUI in a thread. The best choice here is
    to use ipython (http://ipython.scipy.org) with the -pylab option.
    ipython is aware of matplotlib and its rc file, and will read the rc
    file, set the interactive mode, detect the GUI backend, and make the
    proper threading calls. Basically it *just works*. If you are on
    linux, it's an easy install (sudo python setup.py install). On
    windows it's a bit harder, and you may want to look at the 1069
    release candidate of enthought python at
    http://www.enthought.com/downloads/downloads.htm#download, which comes
    with ipython and matplotlib and lots of other goodies. Again, you'll
    need to start ipythhon with

    > ipython -pylab


    In addition to the links above, see also
    http://matplotlib.sf.net/faq.html#SHOW.

    Hope this helps,
    JDH
     
    John Hunter, Apr 28, 2005
    #2
    1. Advertising

  3. Charles Krug

    Charles Krug Guest

    On Wed, 27 Apr 2005 20:56:07 -0500, John Hunter
    <> wrote:
    >>>>>> "Charles" == Charles Krug <> writes:

    >
    > Charles> List: I'm trying to us pylab to see what I'm doing with
    > Charles> some DSP algorithms, in case my posts about convolution
    > Charles> and ffts weren't giving it away.
    >
    > Charles> I've been using pylab's plot function, but I'm finding it
    > Charles> a bit cumbersome.
    >
    > Charles> It works, but if I switch from the interactive window to
    > Charles> the plot window and back, the plot window gets trashed.
    >
    > Charles> Is there a better alternative for interactive use?
    >
    > You are probably not using pylab interactive mode properly.
    > matplotlib has several GUI backends (gtk, tk, qt, etc...). Most GUIs
    > take control with their mainloop and prevent further interaction.
    >>From what you describe, I'm pretty sure you haven't setup your

    > configuration properly for interactive use. Fortunately, there are a
    > couple of solutions.
    >
    > For the standard python shell, you need to use the TkAgg backend.
    > Tkinter is the only python GUI that plays nicely with the standard
    > python shell. You will need to set "backend : TkAgg" and
    > "interactive : True" in the matplotlib rc file. See
    > http://matplotlib.sf.net/interactive.html for details and
    > http://matplotlib.sf.net/.matplotlibrc for information on the
    > configuration file.
    >


    Those are already set. I'm taking a look at ipython now.
     
    Charles Krug, Apr 28, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. paolo
    Replies:
    0
    Views:
    366
    paolo
    Mar 10, 2005
  2. ELAATIFI Sidi Mohamed

    Un plotter de fonctions mathematiques

    ELAATIFI Sidi Mohamed, Jan 25, 2005, in forum: C Programming
    Replies:
    2
    Views:
    362
    CBFalconer
    Jan 25, 2005
  3. Ala

    ODE, GUI, plotter in Python

    Ala, Jun 16, 2009, in forum: Python
    Replies:
    3
    Views:
    702
    Rob Clewley
    Jun 17, 2009
  4. Replies:
    0
    Views:
    297
  5. david croll
    Replies:
    0
    Views:
    77
    david croll
    Jul 30, 2003
Loading...

Share This Page