最佳答案
This solution to another thread suggests using gridspec.GridSpec instead of plt.subplots. However, when I share axes between subplots, I usually use a syntax like the following
fig, axes = plt.subplots(N, 1, sharex='col', sharey=True, figsize=(3,18))
How can I specify sharex and sharey when I use GridSpec ?