Skip to content
UPEEC

Matplotlib

Plot data — waveforms, sensor logs, frequency responses — in a few lines.

Easy
Comments 0
import matplotlib.pyplot as plt

plt.plot(t, signal, label="50 Hz")
plt.xlabel("Time (s)")
plt.ylabel("Voltage (V)")
plt.legend()
plt.grid(True)
plt.show()

Use plt.semilogx for Bode plots and plt.subplots to show several graphs together. Always label axes with units.

Spotted a mistake or want to add detail? Suggest an improvement — Content Contributors' edits are reviewed by editors before they go live.

Discussion (0)

Sign in or join free to ask questions and discuss this topic.