Working with matplotlib to generate graphs, I do not quite understand the difference between these two ways of generating and displaying a graph. I have read documentation about it, but it has not been clear to me.
Form 1:
import matplotlib.pyplot as plt
plt.figure()
plt.plot(x, y)
plt.show()
Form 2:
import matplotlib.pyplot as plt
graph = plt.figure()
plt.plot(x, y)
graph.show()
I know they do not do the same, but the difference is not clear to me.
Can someone explain to me step by step what happens in each case?