r/matplotlib • u/largelcd • Feb 09 '20
Why subplot(1,1,1)
Hi, I know that by using subplot, we can create a figure with several subplots. Supposing that we have (2,3,1), it tells that in the figure, there are 6 subplots in the form of 2x3 (2 rows, 3 columns of subplots). The last element indicates which subplot is of interest. In this case, it is the one on the top left of the figure.
If there is only one plot in the figure, why somebody uses something like:
import matplotlib.pyplot as plt
fig = plt.figure(); ax = fig.add_subplot(1,1,1)
2
Upvotes
View all comments
Show parent comment
2
u/largelcd Feb 29 '20
Thanks. So doing "add_subplot" for a single subplot is kind of like future proof? i.e. In case one needs to add subplots later?