Here is the explanation of the code:
- fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(6, 3)) defines the figure with the size of (6, 3) and two axes in a row on the figure.
- pointA and pointB are the coordinates of two points.
- coordsA and coordsB are the respective coordinate system.
- ConnectionPatch() defines the connection between pointA and pointB:
- arrowstyle specifies a "fancy" arrow.
- shrinkA and shrinkB specify how far away the arrow tip should be from the point they are pointing to, the higher the shrink the longer the distance.
- fc='k' specifies the face color to be black.
- ax1.add_artist(con) plots the connection path defined previously on axes 1
- Then plot points A, B, and C on axes 1, using ax1.text() at appropriate ...