Per the (many) answers to this question, I should try to use plt.subplots() to create figure axes when I'm not interested in an audience of MATLAB
users. One thing that isn't clear to me (and is not shown in the documentation ) is how to create subplots that span multiple axes using this invocation. How to do it other ways, e.g. by repeatedly calling add_subplot
, has been discussed elsewhere.
So, how do I use plt.subplots()
to instantiate a figure with subplots of different sizes?
The folowing code (source) gives the behavior I'm talking about, but with different invocations.
fig = plt.figure()
ax1 = plt.subplot(221)
ax2 = plt.subplot(223)
ax3 = plt.subplot(122)
example_plot(ax1)
example_plot(ax2)
example_plot(ax3)
plt.tight_layout()