So, say I have a function plot(self) within the class Pendulum that calls plot. Then I have another function plot2(self) within the same class Pendulum that also calls plot. How would I set up pyplot such that both functions would call plot on the same figure?
1 Answer
In each plot function: figure(x)
before you call the plots, that makes the plots land on the same figure handle.
figure(1)
plot1(self)
figure(1)
plot2(self)
Edit: This works inside our outside the functions.
2 Comments
InquilineKea
Uh oh - I guess I should have clarified my question better. I really meant "as different subplots within the same plot". But it's okay - I'll ask a variant of this question and upvote what you have.
arynaq
That would work the same way I think, you simply call figure(x) subplot(xxx), figure(x) subplot(xxy).