From my understanding of matplotlib, the figure method creates a new, blank figure, basically a "white canvas," and via, for example, plot I can add the actual plot. The show method then clears the figure:
import matplotlib.pyplot as plt
fig = plt.figure()
plt.plot([0, 1], [0, 1])
plt.show()
1) Now, I am wondering why the same can be achieved when no figure was created. More specifically, I am wondering how matplotlib handles this internally.
2) Is there any advantage in using plt.figure if I don't intend to manipulate figure objects?
import matplotlib.pyplot as plt
plt.plot([0, 1], [0, 1])
plt.show()
