- matplotlib - pulseplot
Pulseplot (powered by pyscript)
To generate pulse-sequence diagrams, just hit `Shift-Enter` on the code block below, or click using the green arrow that appears when you hover over the code block.

This may take a good 60-90 seconds to load when you land on this page (depending on your internet speed), and a few seconds when you execute it for the first time. But any changes you make to the code after that should immediately reflected in the output.
import matplotlib.pyplot as plt import pulseplot as pplot phases = "xyxyyxyx" fig, ax = pplot.subplots(figsize=(10, 3)) ax.set_title("Carr-Purcell-Meiboom-Gill with an XY-8 phase cycle", x=0.41) ax.center_align = True ax.pseq("p1 fc=black ph1") for i in range(8): ax.pseq(fr""" d5 p2 pl1 ph_$\pi_{phases[i]}$ d5 """) ax.pseq("p20 sp=fid ph=rec ec=green") ax.set_ylim(-0.6, 0.8) ax.hlines(0, 0, ax.time-20, color="k", zorder=0) # keep the following line to render the output # to the correct location on this page pyscript.write("output", fig)