import numpy as np
import matplotlib.pyplot as plt
from hyperfine.utilities import split

x = np.linspace(0, 10, 10)
y = 2 * x

fig, ax = plt.subplots(1, 1)
ax.plot(x, y, "-", zorder=1, label="plot")
ax.axvspan(5, 9, color="lightgrey", zorder=0, label="axvspan")

handles_labels = ax.get_legend_handles_labels()

l_1 = ax.legend(*split(handles_labels, "axvspan"), loc="upper left")
ax.add_artist(l_1)
l_2 = ax.legend(*split(handles_labels, "plot"), loc="lower right")

plt.show()