[ Web Proxy ]
URL:
Viewing: https://matplotlib.org/stable/api/_as_gen/../../devel/MEP/../../plot_types/stats/eventplot.html [Back]  [Original]

eventplot(D) — Matplotlib 3.11.2 documentation
Back to top
Search the docs ...:

eventplot(D)#

Plot identical parallel lines at the given positions.

See eventplot.

eventplot [eventplot]
import matplotlib.pyplot as plt
import numpy as np

plt.style.use('_mpl-gallery')

# make data:
np.random.seed(1)
x = [2, 4, 6]
D = np.random.gamma(4, size=(3, 50))

# plot:
fig, ax = plt.subplots()

ax.eventplot(D, orientation="vertical", lineoffsets=x, linewidth=0.75)

ax.set(xlim=(0, 8), xticks=np.arange(1, 8),
       ylim=(0, 8), yticks=np.arange(1, 8))

plt.show()

Gallery generated by Sphinx-Gallery


Web Proxy Viewer  |  New URL  |  Original Page