How to show interactive plot window from program

Hello,

When I'm calling the pyplot.plot function from ipython, I get a nice
dialog in which I can zoom, pan & save.

How can I achieve the same thing from a non-interactive program?

I tried

    fig = plt.figure()
    ax = fig.add_subplot(111)
    ax.contourf(stuff)
    fig.show()

but this program terminates without showing anything. Is there a
function that I can call that shows up the interactive window and only
returns once I close the window?

Thanks,

   -Nikolaus

···

--
»Time flies like an arrow, fruit flies like a Banana.«

  PGP fingerprint: 5B93 61F8 4EA2 E279 ABF6 02CF A9AD B7F8 AE4E 425C

Use plt.show() instead of fig.show()

Ryan

···

On Tue, Apr 20, 2010 at 8:56 AM, Nikolaus Rath <Nikolaus@...3072...> wrote:

Hello,

When I'm calling the pyplot.plot function from ipython, I get a nice
dialog in which I can zoom, pan & save.

How can I achieve the same thing from a non-interactive program?

I tried

fig = plt.figure()
ax = fig.add_subplot(111)
ax.contourf(stuff)
fig.show()

--
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma