See your data#
viz.plot draws a signal or spectrum on the main plot. It accepts a tqt_nmr
object, a plain list/array, or an (x, y) pair.
# Plot the current spectrum
viz.plot(state.spectrum, title="My spectrum")
# Overlay a reference curve without replacing the data
viz.annotate(reference_spectrum, title="Reference")
# Switch the y-axis to log scaling
viz.set_axes(y="log")
To read the peaks the app has picked, use state.peaks — each has a frequency,
height, and linewidth:
You can also detect peaks yourself on any spectrum with tqt_nmr's built-in
find_peaks, then integrate them — no external libraries needed: