Qwt 7.0 New Features¶

Qwt 7.0 is a modernized version based on the original Qwt 6.2.0, following the Qwt open-source license (LGPL), maintained and continuously updated by the community. Qwt 7.0 adds C++11/17 standard support and a CMake build system, along with the features described below.
Integrated 2D/3D Plotting¶
Note — Qwt Supports Both 2D and 3D
Qwt 7.0 integrates the original
QwtPlot3Dlibrary, so one library now covers both 2D and 3D data visualization.
3D Plotting Module Overview¶
Qwt 7.0 includes 3D plotting capabilities that support:
- Plot + Item architecture:
Qwt3DPlot(rendering window) +Qwt3DPlotItem(drawable items), symmetric with 2D'sQwtPlot+QwtPlotItem - Multiple plot types: surface plots, mesh plots, parametric surfaces, function plots
- Modern OpenGL rendering: VBO/VAO + GLSL 3.3 Core shaders (no legacy fixed-function pipeline)
- Interactive operations: mouse rotation, zooming and panning
- Lighting and materials: configurable lights and materials
- Color mapping: automatic color mapping based on Z values, with color bar support
3D Plotting Effects¶

Core Classes¶
| Class | Description |
|---|---|
Qwt3DPlot |
3D rendering window (QOpenGLWidget), manages GL context, view, lighting, coordinate system, and item list |
Qwt3DPlotItem |
Abstract base class for all 3D plot items (attach/detach/draw/hull) |
Qwt3DSurface |
3D surface plot item, displaying continuous surfaces (handles both grid and cell data) |
Qwt3DFunction |
Data generator that creates surfaces from z = f(x, y) mathematical functions |
Note — No Namespace
All 3D classes use the
Qwt3Dprefix directly in the global scope (e.g.,Qwt3DPlot,Qwt3DSurface). There is nonamespace Qwt3D.
Usage Example¶
A minimal 3D program needs only three pieces: a Qwt3DPlot render window, a Qwt3DSurface item attached to it, and a Qwt3DFunction subclass defining z = f(x, y). setDomain() limits the x/y ranges, setMesh() picks the grid resolution, and create() samples the function into the surface, as the example below shows:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | |
CMake Configuration¶
The 3D module ships as its own CMake target: qwt::plot provides the 2D plotting library and qwt::plot3d the 3D module, so projects that never draw in 3D can simply skip the second link line:
1 2 3 4 5 6 7 | |
Tip — Advantages of Integrated 2D/3D
- Unified import: no need to import two separate libraries, which simplifies project dependencies
- Consistent style: the 2D and 3D APIs follow the same style, reducing the learning curve
- Flexible selection: link the 2D or 3D module independently as needed
Example — Complete Example
For detailed usage, refer to Introduction to 3D Plotting. Example code is located in
examples/3D/simpleplot3D.
Architecture and Build Upgrades¶
C++11/17 Standard Support¶
Qwt 7.0 uses the C++ standard required by the Qt version:
- Qt5.12+: Uses C++11 standard
- Qt6: Uses C++17 standard
Code can therefore use auto, nullptr, override, final, lambda expressions and smart pointers.
CMake Build System¶
Qwt 7.0 replaces qmake with a CMake build system:
1 2 3 4 5 | |
Single-File Import Method¶
Qwt 7.0 can also merge the entire library into two files:
src-amalgamate/QwtPlot.h: merged single header filesrc-amalgamate/QwtPlot.cpp: merged single source file
Add these two files to your project; no build configuration is needed. This suits small projects and prototypes.
Warning — Generated Files
The single files are automatically generated by a tool. Do not directly edit the
QwtPlot.handQwtPlot.cppfiles.
QwtFigure — Multi-Plot Layout Container¶
Note — Core New Feature
QwtFigureis new in Qwt 7.0 and provides multi-plot layout capabilities similar to matplotlib's Figure.
Feature Overview¶
QwtFigure is a container window that organizes multiple QwtPlot components. It provides:
- Normalized coordinate layout: a
[0,1]coordinate system for relative position control - Grid layout: row-column grid arrangement, following matplotlib's subplot approach
- Parasite axes support: multiple independent axes within the same plot area
- Graphics export: high-resolution image output
Usage Example¶
QwtFigure accepts sub-plots in two coordinate flavors: addAxes() places a QwtPlot with a normalized [0,1] rectangle, while addGridAxes() drops it into a matplotlib-style row/column grid cell; setSizeInches() sets the physical figure size, as in the snippet below:
1 2 3 4 5 6 7 8 9 10 11 | |
Axis Alignment Feature¶
When multiple sub-plots have different scale ranges, their tick labels have different widths and the plot area edges (axis backbones, grid lines) no longer line up, affecting the visual appearance. QwtFigure provides axis alignment:

The alignment unifies the "canvas inset" of the sub-plots: every plot measures the space its canvas keeps from the widget edge (tick labels, axis titles, legends, color bars and whole parasite axis bands included), the largest inset of a group is applied to all of its members, and the plot area edges end up on one line. The members of a retained grid are aligned automatically (the members of a column share the left/right edges, the members of a row the top/bottom ones); free layouts can name the groups explicitly:
1 | |
Result after alignment:

Note
The alignment works on the real plot area edges, so tick label widths, legends, color bars, parasite axes and hidden axes take part in the calculation - the former "only visible axes can be aligned" restriction is gone.
QwtPlotLayout::setMinCanvasInset()andnaturalCanvasRect()are the public primitives of the mechanism.
Retained Grid Layout with Draggable Dividers¶
QwtFigureGrid keeps the row/column ratios of a QwtFigure as track data. The grid can be enabled with figure->enableGrid(3, 3), the members are registered per cell with addAxes() and addGridItem(), and setGridEditable(true) makes the dividers draggable, so a sub plot can be enlarged with the mouse:

- The track ratios, the gaps and the minimum track extent are read and written through
QwtFigureGrid, so a layout survives a resize and can be stored by the application - A drag only consumes the events inside a narrow band around a divider, so zooming, panning, picking and hovering keep working
gridSizesChanged()drives live previews,gridSizesChangeFinished()is emitted once per drag for a single undo commanddisableGrid()leaves the grid and keeps the current geometry of the members- The plot areas of the members are aligned automatically (
setGridAxisAlignment(), the alignment switch ofexamples/2D/figureGrid)
Example — Complete Example
The usage guide section QwtFigure Plot Container Window explains the model and the interaction under "Retained Grid Layout", the example is located in
examples/2D/figureGrid.
Interactive Operation Overlay¶
QwtFigureWidgetOverlay adds interactive operations to QwtFigure:

- Supports mouse dragging to adjust the position and size of sub-plots
- Supports selecting the currently active plot component
- Provides clear visual feedback (borders, control points, size information)
Example — Complete Example
For detailed usage, refer to QwtFigure Plot Container Window. Example code is located in
examples/2D/figure.
Parasite Axes — Multi-Axis System¶
Note — Core New Feature
Parasite Axes allow creating any number of independent axes within the same plot area, which covers multi-Y-axis and multi-X-axis layouts.
How It Works¶
Parasite plots share the plot area with the host plot (transparent background) but have independent coordinate systems. When the host plot is destroyed, parasite plots are destroyed as well, and their lifecycle is managed automatically.

Creating a Parasite Plot¶
A parasite plot is created from its host with QwtPlot::createParasitePlot(), whose QwtAxis::Position argument picks the axis the parasite lives on; afterwards enableAxis() switches the parasite's own axes on or off and setParasiteShareAxis() lets it share an axis such as the bottom X axis with the host, as shown below:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | |
Multiple Parasite Plot Overlay¶
Multiple parasite plots can be created to overlay any number of axes:

Example — Complete Example
For detailed usage, refer to the Parasite Axes Guide. Example code is located in
examples/2D/parasitePlot.
Interaction Feature Overhaul¶
Note — Major Improvement
Qwt 7.0 rebuilds the interaction classes; the main changes follow.
Real-Time Panning — QwtPlotPanner¶
The original Qwt QwtPanner used bitmap caching for panning, which meant data changes were not visible during the pan operation. Qwt 7.0 has rebuilt QwtPlotPanner based on the QwtPicker state machine to implement real-time panning:

Features:
- Full support for linear axes, logarithmic axes and date-time axes
- Real-time synchronized movement of multiple axes
- Plot refreshes in real time during panning
Canvas-Wide Zooming — QwtPlotCanvasZoomer¶
The original QwtPlotZoomer could only bind to two axes and could not handle four-axis simultaneous zooming scenarios. Qwt 7.0 introduces QwtPlotCanvasZoomer, which requires no axis specification and automatically handles zooming for the entire canvas:
1 2 | |
Class Name Changes¶
To maintain naming clarity, some class names have been adjusted:
| Original Name | New Name | Description |
|---|---|---|
QwtPlotZoomer |
QwtPlotAxisZoomer |
Can only bind 2 axes, renamed to axis zoomer |
| - | QwtPlotCanvasZoomer |
New: canvas-wide zoomer |
QwtPanner |
QwtCachePanner |
Cache-based panner |
QwtPlotPanner |
QwtPlotCachePanner |
Cache-based plot panner |
| - | QwtPlotPanner |
New: real-time panner |
Tip — Migration Tip
Existing code requires minimal changes, as the new interfaces maintain backward compatibility. To use the original cache-based panning, use the
CachePannerrelated classes.Example — Complete Example
For detailed usage, refer to the Panner Tool and Zoomer Tool.
Built-in Axis Interactive Actions¶
Note — New Feature v7.0.5+
Axis interactive actions allow users to directly manipulate axes with the mouse, providing an experience similar to QCustomPlot.
Feature Demonstration¶
Axis drag operation:

- Left-click to select an axis
- Drag to move the axis range
- Right-click to deselect
Axis scroll wheel zoom:

- Left-click to select an axis
- Scroll wheel to zoom, with zoom center at the mouse position
- Right-click to deselect
Usage¶
Qwt 7 enables axis interaction by default:
1 2 3 4 5 | |
Selection Effect Customization¶
When an axis is selected, visual effects can be customized:

1 2 3 4 5 | |
Example — Complete Example
For detailed usage, refer to Axis Interactive Actions.
Data Picking Feature¶
Note — New Feature v7.0.6+
QwtPlotSeriesDataPickershows data point information as the mouse moves.
Feature Demonstration¶

Two Picking Modes¶
Y-value picking mode:

Displays the Y values for all curves at the current X position, with support for linear interpolation.
Nearest point picking mode:

Calculates and picks the closest point to the mouse cursor, suitable for peak data picking scenarios.
Usage Example¶
QwtPlotSeriesDataPicker is constructed on the plot canvas, and two enums drive its behavior: setPickMode() selects PickYValue (the Y values of all curves at the current X position; this is the default) or PickNearestPoint (the sample closest to the cursor), while setInterpolationMode() toggles between NoInterpolation and LinearInterpolation; the snippet below also restyles the tooltip background with setTextBackgroundBrush():
1 2 3 4 5 6 7 8 9 10 11 | |
Performance Optimization¶
For large datasets, Qwt 7 provides a window search algorithm:
- Default activation threshold: 1,000 data points
- Search window defaults to 5% of the curve point count
- Avoids traversing the full curve, which speeds up picking
Example — Complete Example
For detailed usage, refer to Data Picking.
New Chart Types¶
Box Chart — QwtPlotBoxChart¶
Note — New Feature v7.2.0+
QwtPlotBoxChartdraws box-and-whisker plots for showing the distribution of a data set.

Features¶
- Supports both pre-computed data and automatic calculation from raw data
- Multiple whisker calculation methods: Tukey (1.5×IQR), percentile, min/max, standard deviation, standard error
- Three box styles: rectangle, diamond, notch
- Vertical and horizontal orientation switching
- Automatic outlier detection, custom symbols and jitter display
Box Chart Structure¶

Usage Example¶
QwtPlotBoxChart accepts either pre-computed statistics or raw samples; in the pre-computed case each QwtBoxSample carries position, lower/upper whisker, Q1, median and Q3 and is fed through setSamples(), while setBoxStyle() picks the box appearance (Rectangle, Diamond or Notch), as the example below demonstrates:
1 2 3 4 5 6 7 8 9 10 11 12 | |
Example — Complete Example
For detailed usage, refer to the Box Chart Guide. Example code is located in
examples/2D/boxchart.
Other Useful Features¶
Inward-Facing Ticks¶
Note — New Feature v7.2.1+
Supports displaying axis tick marks inside the plot area, suitable for compact layout scenarios.

1 2 3 | |
Example — Complete Example
For detailed usage, refer to the Inward-Facing Ticks Guide. Example code is located in
examples/2D/ticks_inside.
NaN/Inf Anomaly Value Handling¶
Qwt 7.0 improves handling of anomalous values (NaN, Inf) in data:
QwtPointMapperadds anomaly handling so that data anomalies do not cause coordinate mapping errors- Data range calculation includes anomaly value filtering
- Plotting no longer crashes on anomalous data
QwtGridRasterData Grid Interpolation¶
The new QwtGridRasterData class differs from QwtMatrixRasterData in these ways:
- Supports 2D data table input
- Supports X/Y axis grid interpolation
- More options for spectrogram data processing
Bar Chart Interface Enhancements¶
QwtPlotBarChart interface enhancements include:
- Pen style settings
- Brush (fill) style settings
- More bar chart appearance options
Migration Guide¶
Class Name Change Reference¶
| Original Name | New Name | Migration Advice |
|---|---|---|
QwtPlotZoomer |
QwtPlotAxisZoomer |
Simply replace the class name in code |
QwtPanner |
QwtCachePanner |
Replace if cache-based panning is needed |
QwtPlotPanner |
QwtPlotCachePanner |
Replace if cache-based panning is needed |
| - | QwtPlotPanner |
New feature: real-time panning |
| - | QwtPlotCanvasZoomer |
New feature: canvas-wide zooming |
API Changes¶
QwtLinearColorMap::colorStop()→stopPos()QwtLinearColorMapaddsstopColors()method
Compatibility¶
- Qt5.12+ fully compatible
- Qt6 fully supported
- Most Qwt 6.x code can be used directly, requiring only minor class name replacements
Summary¶
Qwt 7.0 changes the library in these areas:
| Category | New Features |
|---|---|
| Architecture Upgrade | C++11/17, CMake build, single-file import |
| Integrated 2D/3D | QwtPlot3D integration, unified library supporting 2D and 3D plotting |
| Layout Features | QwtFigure multi-plot container, parasite axes for multi-axis support |
| Interaction Improvements | Real-time panning, canvas-wide zooming, built-in axis interaction |
| Data Picking | Y-value picking, nearest-point picking, smart interpolation |
| Chart Types | Box chart, inward-facing ticks, 3D surface/mesh plots |
| Stability | NaN/Inf handling, anomaly value filtering |
Info — Get More Information
- Project Repository: GitHub / Gitee
- Build Instructions: Build Guide
- Import Method: Importing Qwt
- Changelog: CHANGES.md