Whenever I use matplotlib, I will perform something like the following in an
ipython shell (no special flags):

import matplotlib.pyplot as plt
fig = plt.figure()

<do things, like adding axes to the figure and plotting>

fig.show()    # this will cause the window to pop up, and give me back a
prompt for ipython

<do more things, like modifying the axes and updating using plt.draw()>

fig.savefig(...)    # if you want to save a copy

<do more things>

As far as I have seen, this is not one of the recommended methods in the
documentation, and considering my cursory understanding of the internals,
I'm not sure if this is technically correct or a hack, but it works
perfectly well for me.  I discovered this function in Figure objects when I
was trying to get around exactly the same problem.

Uri

---------- Forwarded message ----------
From: qu...@gmx.at
To: Jeff Whitaker <jsw...@fastmail.fm>
Date: Wed, 14 Oct 2009 02:09:21 +0200
Subject: Re: [Matplotlib-users] plotting from within ipython, and then go on
in the shell calculations
but i want to:
 1) plot something
 2) go on in ipython (with the figure/plot staying on)

is that really not possible?

thanks,
q
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to