Dec-23-2020, 01:46 PM
(Dec-22-2020, 09:58 PM)MK_CodingSpace Wrote: When you do subplot, it should be something like this
fig, axs = plt.subplots(2) axs[0].plot(x, y) axs[1].plot(x, -y)
I was using a state-based approach here. Your response discusses an object-oriented approach, which we used successfully in the other thread.
Assuming I stuck with this state-based approach, though, I don't understand why they didn't print as subplots. If the line I tried at 10 or 22 stays at 10, then there's nothing in the for loop to direct which subplot should be drawn. If that line goes at 22, though, then shouldn't it direct which subplot to draw? It doesn't. Why?