I have a series of subplots, and I want them to share x and y axis in all but 2 subplots (on a per-row basis).
I know that it is possible to create all subplots separately and then add the sharex
/sharey
functionality afterward.
However, this is a lot of code, given that I have to do this for most subplots.
A more efficient way would be to create all subplots with the desired sharex
/sharey
properties, e.g.:
import matplotlib.pyplot as plt
fix, axs = plt.subplots(2, 10, sharex='row', sharey='row', squeeze=False)
and then set unset the sharex
/sharey
functionality, which could hypothetically work like:
axs[0, 9].sharex = False
axs[1, 9].sharey = False
The above does not work, but is there any way to obtain this?