1

One can do

fig, ax = subplots(nrows=2, ncols=2, sharex=True, sharey=True)

to make axes sharing axis.

I want to tie together different axis of different subplots in a more complicated way, e.g., x-axis of ax1 to ax2, but y-axis of ax2 to ax3 and such.

One way I think is to call subplot and use sharex/sharey keywords, but this is done at creation. Is there an object-oriented way to do this in matplotlib after the creation of axes?

pyrookie
  • 400
  • 3
  • 11

1 Answers1

0

I think there is a way to do this now.

see:
- How share x axis of two subplots after they are created?
- matplotlib set shared axis

So your example I think would look something like this:

ax1.get_shared_x_axes().join(ax1, ax2)
ax2.get_shared_y_axes().join(ax2, ax3)
Community
  • 1
  • 1
jay--bee
  • 672
  • 1
  • 6
  • 8