Reputation: 891
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?
Upvotes: 1
Views: 821
Reputation: 6870
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.
Upvotes: 1