Код: Выделить всё
axes.legend()
fig, ax = plt.subplots(1,1)
ax.plot(meas['times'], meas['data'], label='measurement')
vlins = ax.vlines([trigger_time], 0, 100)
lines, labels = ax.get_legend_handles_labels()
# there is no: vvvvvvvvv
ax.legend( lines + vlins.to_list(), labels + ['trigger event']
< /code>
Существует много документации о том, как создать LineCollection. Но это кажется билетом в одностороннем виде.
Подробнее здесь: https://stackoverflow.com/questions/795 ... collection