Note
Go to the end to download the full example code.
Event plot

Live figure — pick a tool, then zoom, pan, point-pick or annotate. Nothing is active until a tool is selected.
import numpy as np
import plotpress
rng = np.random.default_rng(4)
rows = [np.sort(rng.uniform(0, 10, 40)) for _ in range(6)]
fig, ax = plotpress.subplots()
ax.eventplot(rows)
ax.set_title("eventplot"); ax.set_xlabel("time")
fig.tight_layout()
Total running time of the script: (0 minutes 0.077 seconds)