I've made a small predator and prey simulation (here: foxes and hares) in Python. Consider the following piece of code:
import matplotlib.pyplot as plt
plt.plot(foxchronicle, harechronicle)
plt.show()
It outputs a plot of the trajectory of the populations in fox-hare space, for example one run produced this picture:
Now I wanted the picture to be larger, so I googled and someone on the Internet said I should add this line right after importing the library:
fig = plt.figure(figsize=(18, 14), dpi=80)
The resulting code is this:
import matplotlib.pyplot as plt
fig = plt.figure(figsize=(18, 14), dpi=80)
plt.plot(foxchronicle, harechronicle)
plt.show()
It did work and produced this picture:
(Note that this picture captures a different data set, because my program generates them afresh at each run.)
Now I'm confused, because the variable "fig" does not at all occur in the two commands that follow and that use "plt". How can this be? As I read the code, I am merely creating a variable and then never using it.
Note: In contrast to the questions in the closing vote, this question asks neither about the general workings of matplotlib nor about any plot function, but very specifically about how matplotlib manages the figure that it's going to draw next.
In particular, it is not about the object-oriented interface, which I used only by accident.