AZPlottingClass
A wrapper around QCustomPlot to simplify our plotting workflow. Handles log scales, symlog, real-time streaming, styling, and export.
Basic Usage
#include "AZPlottingClass.h"
AZPlottingClass *plot = new AZPlottingClass(parent);
QVector<double> x, y;
for (double t = 0.01; t <= 100; t *= 1.1) {
x.append(t);
y.append(1000 * exp(-t / 20));
}
plot->addDataSeries(x, y, "Response", Qt::blue);
plot->setXAxisScale(AZPlottingClass::ScaleType::Logarithmic);
plot->setYAxisScale(AZPlottingClass::ScaleType::Logarithmic);
plot->setXAxisLabel("Time (ms)");
plot->setYAxisLabel("dB/dt (nV/m^2)");
plot->applyProfessionalStyle();
plot->setInteractive(true, true);
plot->autoScaleAll();
Controls
| Action | Control |
|---|---|
| Pan | Click + Drag |
| Zoom Both Axes | Scroll wheel |
| Zoom X Only | Shift + Scroll |
| Zoom Y Only | Ctrl + Scroll |
| Rubber Band Zoom | Z + Drag |
| Reset Zoom | Double-click or R |
| Zoom Back | Right-click |
| Toggle Grid | G |
| Toggle Legend | L |
| Toggle Crosshair | C |
| Toggle Statistics | S |
Requirements
Qt 5.12+ or Qt 6.x, C++17, QCustomPlot 2.1.1 (included in src/).