problem with show()

Hi, I'm learning how to use matplotlib and I'm having a

    > problem with show(). I did the simplest example of the
    > Tutorial on the Matplotlib's homepage:

    > from matplotlib.matlab import * plot([1,2,3,4]) show()

    > It works fine, but when I try to run it again (second time
    > on the same session), the plot is not shown. I have
    > another question too: when I run the show() command, my
    > program stops and only continues when I close the plot
    > windows. Is there anyway of show the plot and continues
    > the program with the plot window openned?

    > I'm using matplotlib 0.64.4-1 on a Debian GNU/Linux.

Is this the right version number? I didn't know matplotlib 0.64 was
out yet :slight_smile:

    > Sorry about my poor english.

I didn't even notice - it's not that poor!

The usage of show is a source of confusion to all new users of
matplotlib -- you are not alone. Please see the FAQ
http://matplotlib.sf.net/faq.html#SHOW. The main idea is that show is
only meant to be used in matplotlib scripts, not interactively from
the python shell. If working interactively (type some commands, look
at a figure, type some more commands), you need to set interactive to
be True in your rc file. Once you have done this (and restarted
python) you won't need to call show at all in an interactive session.
See also http://matplotlib.sf.net/interactive.html and
http://matplotlib.sf.net/.matplotlibrc.

I will try and update the tutorial to make this clearer.

For interactive work, I also recommend you set your backend to TkAgg
in your .matplotlibrc file. Or use ipython with the pylab option -
google for matplotlib and ipython.

Hope this helps,
JDH