MCPcopy Create free account
hub / github.com/Klipper3d/klipper / plot_specgram

Function plot_specgram

scripts/graph_accelerometer.py:160–171  ·  view source on GitHub ↗
(data, logname, max_freq, axis)

Source from the content-addressed store, hash-verified

158
159# Plot data in a "spectrogram colormap"
160def plot_specgram(data, logname, max_freq, axis):
161 pdata, bins, t = calc_specgram(data, axis)
162
163 fig, ax = matplotlib.pyplot.subplots()
164 ax.set_title("\n".join(wrap("Spectrogram %s (%s)" % (axis, logname),
165 MAX_TITLE_LENGTH)))
166 ax.pcolormesh(t, bins, pdata, norm=matplotlib.colors.LogNorm())
167 ax.set_ylim([0., max_freq])
168 ax.set_ylabel('frequency (hz)')
169 ax.set_xlabel('Time (s)')
170 fig.tight_layout()
171 return fig
172
173######################################################################
174# CSV output

Callers 1

mainFunction · 0.85

Calls 1

calc_specgramFunction · 0.85

Tested by

no test coverage detected