The web documentation for matplotlib.axes.Axes.sharex state that Axes.sharex(ax) “is equivalent to passing sharex=ax when constructing the axes”
I found it’s not really true, at least in interactive mode.
When we use add_axes(…, sharex=…), the Axis is shared and the xlims and ticks are also shared.
If we use Axes.sharex=ax the xlims and xticks are not shared.
Maybe there’s a purpose for the discrepancy, but I can’t understand it.
PS: tested with mpl3.3.4 and python3.8