[IPython-User] IPy Notebook: Continue plotting in the same figure from another cell

Matthias Bussonnier bussonniermatthias@gmail....
Thu Jan 10 02:25:51 CST 2013


Short from my phone.

There is an autoclose option on profile/command line see --help-all
Set it to false.

Or the preferable way. Use matplotlib OO interface:

Fig,ax =subplots(1,1)
ax.plot(...)

Markdown

ax.dosomethingelse(...)

Which is the real way of using matplotlib without pylab magic. It is much
more powerfull.
-- 
Matthias
 Le 10 janv. 2013 09:09, "Norfeldt" <lasse@norfeldt.dk> a écrit :

> This is properly a trivial question and due to my lack of experience with
> matplotlib (come from a MATLAB environment) :
>
> Here is an illustration of my question:
>
> --Cell 1----------------------------------
> fig = figure(1)
> fig.clf()
>
> count, bars, ignored = hist(very_very_big_population, 40, normed=True)
> plot(bars, bell_curve_data(bars), color='r')
> -------------------------------------------
>
> -- Markup cell ----------------------
> Some text explaining what I want to do next or other stuff.
> -------------------------------------------
>
> --Cell 2--------------------------------
> fig # continue plotting on the previous figure
>
> plot(bars, some_other_data, color='g')
> ------------------------------------------
>
> However I can't seem to continue plotting on the same figure and have to
> run
> the hist and plot again - which takes time since it is really a big big
> population...
>
> How do I continue plotting on the figure from the previous cell (Cell 1)
> ________________________?
>
>
> BONUS QUESTION:
>
> While typing this I quickly started thinking if it is possible to copy the
> figure with plot ____________________?
> So say I want to plot something in Cell 2 on the the figure from Cell 1 but
> still want to be able to get a "clean" (without the Cell 2 plotting) Cell 1
> figure in Cell 3 and do some different plotting on this.
>
>
>
> --
> View this message in context:
> http://python.6.n6.nabble.com/IPy-Notebook-Continue-plotting-in-the-same-figure-from-another-cell-tp5001910.html
> Sent from the IPython - User mailing list archive at Nabble.com.
> _______________________________________________
> IPython-User mailing list
> IPython-User@scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/ipython-user/attachments/20130110/0312fee2/attachment.html 


More information about the IPython-User mailing list