This is probably a very naive question, but I can't find clear instructions how to do this. What I am trying to do in matplotlib is:
- Do some calculations
- Create a figure or an axis object?
- Add data to the object, plot it
- Do some more calculations
- Add new data to the object as a new layer (not extend existing data, but have a new line/scatter)
I want to do something like:
x = rand(10)
y = rand(10)
p = plot(x,y, '.', label="x:y")
# other code, possibly a new cell in the notebook
a = rand(10)
b = rand(10)
p.plot(a,b, '--', label="a:b") # error. what do I do to add a layer here?
The final plot should contain both (x,y) and (a,b) data.
I am NOT interested in having a bunch of subplots (every example seems to have those) and I want to do the above in the pylab plot (in an IPython notebook).
Thanks!