What is an efficient way to assign the same specs (for example, xlim
) to matplotlib unpacked subplots?
I have
<code>fig, (axs1, axs2,axs3) = plt.subplots(3, sharex=True, figsize=(10,6), gridspec_kw={'height_ratios': [2, 1, 1], 'hspace':0})
</code>
<code>fig, (axs1, axs2,axs3) = plt.subplots(3, sharex=True, figsize=(10,6), gridspec_kw={'height_ratios': [2, 1, 1], 'hspace':0})
</code>
fig, (axs1, axs2,axs3) = plt.subplots(3, sharex=True, figsize=(10,6), gridspec_kw={'height_ratios': [2, 1, 1], 'hspace':0})
And I want to cycle over them, or find a common object similar to plt.setp(), to share same specs for all axes, for example to avoid:
<code>axs1.set_xlim(0., 1.)
axs2.set_xlim(0., 1.)
axs3.set_xlim(0., 1.)
</code>
<code>axs1.set_xlim(0., 1.)
axs2.set_xlim(0., 1.)
axs3.set_xlim(0., 1.)
</code>
axs1.set_xlim(0., 1.)
axs2.set_xlim(0., 1.)
axs3.set_xlim(0., 1.)