Eyediagram
Tools for plotting an eye diagram in Python.
Install / Use
/learn @WarrenWeckesser/EyediagramREADME
eyediagram
eyediagram is a python library for generating eye diagrams (also known as
eye patterns).
This is prototype-quality software. The documentation is thin, and the API may change.
To build the package, cython and numpy must be installed.
To use the package, numpy and scipy must be installed. Plots are generated with
either matplotlib (http://matplotlib.org/) or bokeh (http://bokeh.pydata.org/),
so usually either one of those must be installed. However, the core function
eyediagram.core.grid_count generates a numpy array that can be displayed or
saved as an image using any other plotting or image-handling software, so it
is not a strict requirement that matplotlib or bokeh be installed. See
the script pyqtgraph_demo.py in the demo directory for an example that
uses pyqtgraph (http://www.pyqtgraph.org/) to display the eye diagram. The
plot generated by that script is shown below.
Example - matplotlib
This is mpl_demo.py. It uses the eyediagram function from the
eyediagram.mpl module to plot an eye diagram using matplotlib.
from eyediagram.demo_data import demo_data
from eyediagram.mpl import eyediagram
import matplotlib.pyplot as plt
num_symbols = 5000
samples_per_symbol = 24
y = demo_data(num_symbols, samples_per_symbol)
eyediagram(y, 2*samples_per_symbol, offset=16, cmap=plt.cm.coolwarm)
plt.show()

Example - bokeh
This is bok_demo.py. It uses the eyediagram function from the
eyediagram.bok module to plot an eye diagram using bokeh.
from eyediagram.demo_data import demo_data
from eyediagram.bok import eyediagram
from matplotlib.cm import coolwarm
from bokeh.plotting import show
# Get some data for the demonstration.
num_symbols = 5000
samples_per_symbol = 24
y = demo_data(num_symbols, samples_per_symbol)
p1 = eyediagram(y, 2*samples_per_symbol, offset=16, cmap=coolwarm,
filename='bok_demo.html')
# If you don't want the dependency on matplotlib, replace `cmap=coolwarm`
# with, say, `color=(160, 145, 50)`.
show(p1)

Example - pyqtgraph
The script pyqtgraph_demo.py in the demo directory shows how an eye diagram can be
displayed using the graphics library pyqtgraph. It generates this plot:

Related Skills
node-connect
345.9kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
claude-opus-4-5-migration
106.4kMigrate prompts and code from Claude Sonnet 4.0, Sonnet 4.5, or Opus 4.1 to Opus 4.5
frontend-design
106.4kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
model-usage
345.9kUse CodexBar CLI local cost usage to summarize per-model usage for Codex or Claude, including the current (most recent) model or a full model breakdown. Trigger when asked for model-level usage/cost data from codexbar, or when you need a scriptable per-model summary from codexbar cost JSON.
