'Difference between figsize and fig.add_axes in matplotlib

I am learning the matplotlib library. One thing I didn't understand is figsize and fig.add_axes([0,0,x,x]) are both doing the same thing, aren't they?

For example:

fig1 = plt.figure(figsize=(8,2))
ax1 = fig.add_axes([0,0,2,2])

and

fig2 = plt.figure(figsize=(17,4))
ax2 = fig.add_axes([0,0,0.8,0.8])

Both are producing the same plot area. So where is the difference between two?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source