This problem seems simple enough, but I can not find a pythonic way to solve it. I have several (four) subnets that should have the same xlim and ylim . Iterate over all subtasks Γ la
f, axarr = plt.subplots(4) for x in range(n): axarr[x].set_xlim(xval1, xval2) axarr[x].set_ylim(yval1, yval2)
- This is not the most pleasant way to do things, especially for 2x2 subheadings - thatβs what I really mean. I am looking for something like plt.all_set_xlim(xval1, xval2) .
Please note that I do not want to change anything (ticks and tags must be controlled separately).
EDIT: I am using the plt.subplots(2, 2) wrapper. After dienzs answer, I tried plt.subplots(2, 2,sharex=True, sharey=True) - almost correctly, but now the ticks have disappeared, except for the left and bottom lines.
source share