ConnectionPatch axesA has to be the "latest" axes

It would seem the axesA keyword always has to be the “latest” axes. If not, the connector does not get added to the figure.

Minimal, complete and verifiable example:


from matplotlib.patches import ConnectionPatch
import matplotlib.pyplot as plt
import matplotlib as mpl
import platform


xya = (.5,.5)
xyb = (.6,.7)

shows nothing

f1, (ax11, ax12) = plt.subplots(1,2, sharey=False)
con1 = ConnectionPatch(xyA=xya, xyB=xyb , coordsA=‘data’, coordsB=‘data’, axesA=ax12, axesB=ax11)

shows clipped line

f2, (ax21, ax22) = plt.subplots(1,2, sharey=False)
con2 = ConnectionPatch(xyA=xyb, xyB=xya , coordsA=‘data’, coordsB=‘data’, axesA=ax21, axesB=ax22)

shows desired result

f3, (ax31, ax32) = plt.subplots(1,2, sharey=False)
con3 = ConnectionPatch(xyA=xya, xyB=xyb , coordsA=‘data’, coordsB=‘data’, axesA=ax32, axesB=ax31)

shows nothing

f4, (ax41, ax42) = plt.subplots(1,2, sharey=False)
con4 = ConnectionPatch(xyA=xyb, xyB=xya , coordsA=‘data’, coordsB=‘data’, axesA=ax41, axesB=ax42)


While reference to clipping is made in the user guide1, the seemingly forced choice of axesA had me stumped for quite some time. While I understand that the choice of the axes to add the connector is important to avoid overlap (in other words, on which axes one should call the add_artist method), it seems unimportant whether xyA or xyB are referenced in ax1 or ax2.

To clarify: I was expecting example 4 above to show a similar line as example 3.