In this recipe, we will learn how to use the ConnectionPatch() method to connect two points on the same plot or two different plots on the same figure. This comes in handy when trying to show a relationship between two points on the plot(s).
Using ConnectionPatch
Getting ready
Import the required libraries:
from matplotlib.patches import ConnectionPatch
import matplotlib.pyplot as plt
How to do it...
The following code block plots two axes, four points, and the connectivity between them. This is a kind of annotation without any text:
- Define the figure, size, layout, and...