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

ActionControl
PanClick + Drag
Zoom Both AxesScroll wheel
Zoom X OnlyShift + Scroll
Zoom Y OnlyCtrl + Scroll
Rubber Band ZoomZ + Drag
Reset ZoomDouble-click or R
Zoom BackRight-click
Toggle GridG
Toggle LegendL
Toggle CrosshairC
Toggle StatisticsS

Requirements

Qt 5.12+ or Qt 6.x, C++17, QCustomPlot 2.1.1 (included in src/).