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

Norfeldt lasse@norfeldt...
Thu Jan 10 02:09:01 CST 2013

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)

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

How do I continue plotting on the figure from the previous cell (Cell 1)


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.

More information about the IPython-User mailing list