github czyt1988/QWT v7.5.0
QwtPlot v7.5.0

latest releases: v7.6.1, v7.6.0, v7.5.2...
one month ago

New Features

  • True LTTB downsampling for curves (FilterPointsLTTB rework)
    • FilterPointsLTTB now implements the real Largest-Triangle-Three-Buckets algorithm ( new QwtPointMapper::LTTBReduce flag, qwtLttbReduce() ): the visible data is divided into 4 x canvas-width equal-count buckets and each bucket keeps the sample forming the largest triangle with the previously selected point and the average of the next bucket; the first and last sample are always kept
    • Narrow Gaussian peaks keep their shape instead of collapsing into vertical strokes; the activation threshold ( 4 x canvas-width visible samples ) and the output budget ( ~4 points per pixel column ) match the previous MinMax bucket algorithm
    • The MinMax bucket algorithm moved to the new FilterPointsMinMaxLTTB paint attribute - it is the exact behavior of FilterPointsLTTB in v7.3.2 - v7.4.2
    • Dispatch priority: PixelColumnReduce > LTTBReduce > MinMaxReduce > WeedOutIntermediatePoints > WeedOutPoints; the default stays ClipPolygons | FilterPointsLTTB ( now the shape-preserving LTTB )
    • Regression tests: tests/downsampling_test; examples/bench/renderbench gains a FilterPointsMinMaxLTTB benchmark mode
  • 3D waterfall plot item (Qwt3DWaterfall)
    • New Qwt3DPlotItem rendering a sequence of 1D traces (spectra, chromatograms, ...) as stacked curves along the depth axis, with a built-in sliding window: pushTrace() appends the newest trace and drops the oldest, no user-side window or depth bookkeeping
    • Axes follow the module convention (value axis up, as in Qwt3DSurface): x = bin value, y = trace position in the window (depth), z = amplitude; the depth axis is the one to label with Qwt3DTextScale
    • The depth coordinate of a trace is its slot index, so the hull z-range grows monotonically to [0, traceCapacity()-1] and then stays pinned - no per-frame depth autoscale jitter in a live waterfall
    • Four geometry styles: Ribbon (filled curtain, default), RibbonMesh (curtain + outline, outline always drawn after the fill), Wireframe, Tube (lit, same construction as Qwt3DLine::Tube)
    • Three color modes: ByDepth (default), ByAmplitude (colormap over the sample value), Solid; fixed color range via setColorRange() for stable live amplitude colors; baseline, opacity and outline controls; one item contributes exactly one legend gradient
    • New example examples/3D/waterfall3D: 2D live spectrum + peak hold on top, 3D sliding-window waterfall below, both fed the identical frame; toolbar controls for window size / style / colormap / color mode / opacity; automation hooks --screenshot, --selftest, --fps (measured 51.8 fps at 64 traces x 256 bins with both views updating)
    • New usage guide "3D Waterfall" (EN/CN, with screenshot); RTTI value Rtti_Plot3DWaterfall = 1004; theme branch in Qwt3DTheme::applyToItem(); classincludes forwarding headers
  • Qwt3DTextScale: user supplied tic labels for the depth axis
    • Linear scale whose major tic labels come from a string list, so a waterfall depth axis can read "-63", "-48", ..., "0" (frames ago) instead of raw numbers; indices beyond the list fall back to the numeric label
  • Qwt3DColorMapColor: selectable source axis
    • New Qwt3DColorSource enum (ColorFromX/ColorFromY/ColorFromZ) with setSourceAxis()/sourceAxis(); the active range applies to the selected axis. The default ColorFromZ keeps existing surface/bar/line rendering pixel-identical; ColorFromY powers amplitude coloring. Qwt3DWaterfall::setColorMode() retargets the functor automatically
  • Qwt3DPlot: configurable mouse driven view interaction
    • setMouseSpeed()/mouseSpeed() set the drag speeds (rotation turns per widget dimension, exponential gain of drag scaling, world units of drag shifting); the defaults are (0.5, 5, 2), i.e. half a turn per widget dimension, the sensitivity of matplotlib's 3D rotation
    • setRollMouse()/rollMouse() add an extra gesture for the y axis rotation (the roll, the one angle a plain left drag cannot reach); the middle button carries it by default and the Shift+left assignment keeps working
  • Gap semantics for curve rendering (QwtPlotCurve::BreakAtNan)
    • New curve attribute rendering NaN/Inf samples as gaps instead of bridging them: for Lines and Steps every run of consecutive finite samples becomes an independent polyline, so gaps stay blank (matplotlib behavior). Off by default - without it gaps are bridged exactly as before
    • Each run is smoothed, fitted, clipped and filled on its own, so neither the smoothing kernel nor the fill area crosses a gap; downsampling budgets apply per run. Dots/Sticks are unaffected (per-sample styles already leave gaps blank)
    • The finite sample runs are scanned once per data change and cached (invalidated via dataChanged(), same lifecycle as the series bounding rect cache), so interactive repaints don't repeat the O(n) scan
    • Documented in the "NaN Handling" usage guide (EN/CN); rendering semantics and the bridging-chord measurements: docs/zh/tech-report/nan-rendering.md

Bug Fixes

  • Fixed downsampling destroying the visual shape of narrow peaks and ignoring antialiasing: the default FilterPointsLTTB ( MinMax buckets, v7.3.2 - v7.4.2 ) kept only the argmin/argmax sample per bucket, so a peak sampled by more points than its bucket held collapsed into a flat-topped vertical stroke with the shoulders lost, and all reduce paths snapped the mapped coordinates to integer pixels regardless of the RoundPoints flag - enabling antialiasing changed nothing. Both reduce algorithms now honor RoundPoints ( sub pixel precision when the painter does not align to integers, including the below-threshold fallback ), and the default downsampling is the true LTTB preserving peak shapes. Regression test: tests/downsampling_test

  • Fixed the amalgamated single-file build ( src-amalgamate, consumed by examples/staticExample ) not linking since the 3D waterfall landed: the amalgamate templates never listed qwt3d_waterfall.h/.cpp, so Qwt3DTheme::applyToItem() referenced Qwt3DWaterfall setters that had no definition inside the amalgamation. Templates updated and src-amalgamate regenerated; the duplicate file-local clampf() helper of qwt3d_waterfall.cpp was renamed to clampFloat() so the single translation unit compiles. Also dropped the Qt5-only QwtPlotGLCanvas include from tests/flat_style_test, which failed to compile under Qt6 ( <qgl.h> does not exist there )

  • Fixed the axis backbones not intersecting at the canvas corners and the axis/tick lines rendering with inconsistent widths on HiDPI displays: QwtScaleDraw now paints backbone and ticks as device pixel aligned filled rectangles (the pen width truncates to whole device pixels, so setPenWidthF(1.0) stays a one pixel hairline at any device pixel ratio), ticks end exactly at the inner edge of the backbone instead of crossing it, ticks at the scale borders snap onto the perpendicular backbone so the corner reads as a clean cross without a one pixel step between the border tick and the perpendicular axis line, and the new QwtScaleDraw::setCornerMiter() flags - set by QwtScaleWidget from the visibility of the perpendicular axes - extend each backbone by one pen width into the shared canvas corner, so perpendicular backbones meet in a clean L instead of a diagonal step (or, at fractional scaling, an outright gap). Regression test: tests/axis_corner_test

  • Fixed Qwt3DPlot::attach() not recalculating the scene: an item whose data was loaded before attach() - with no setter (and therefore no itemChanged()) in between - left the plot hull at (0,0,0)-(0,0,0) and the widget rendered blank without any warning. The z-order sort + hull union + coordinate system update is extracted into a private recalculateScene(), now also called from attach() and detach(), so detaching items shrinks the hull correctly as well. Regression tests added (tests/waterfall_test)

  • Fixed derived Qwt3DScale classes being sliced inside Qwt3DAxis::setScale(): the Qwt3DClonePtr assignment clones via clone(), and any derived scale without a clone() override silently lost its custom ticLabel() (verified pixel-identical rendering). Qwt3DTextScale overrides clone(); Qwt3DLinearScale gains a protected copyLinearScaleState() so derived implementations can copy the autoscaler state

  • Fixed Qwt3DWaterfall::pushTrace() reading past the end of a short trace: incoming frames are fitted into the established bin count (longer truncated, shorter zero-padded)

  • Fixed the 3D axis titles never showing on live plots: Qwt3DCoordinateSystem::destroy() (called by init() on every coordinate system recreation) cleared all axis label strings, and title drawing stayed off unless setLabel(true) was called separately. setLabelString() now enables drawing for a non-empty title and init()/destroy() keep the titles; Qwt3DAxis::label() exposes the draw flag

  • Fixed Qwt3DCoordinateSystem::init() resetting every axis scale to LINEARSCALE on each recreation: for items whose hull changes per update (a live waterfall) this silently discarded a user-set Qwt3DTextScale and fell back to numeric depth labels. init() now rebuilds geometry only, and Qwt3DAxis::scale() exposes the active scale

  • Fixed Qwt3DWaterfall::Tube fusing into a single blob and collapsing the frame rate: the sweep radius was isotropic in data space, so under anisotropic view scales neighboring traces overlapped and cross sections stretched into slabs, and every ring station of every trace was rebuilt per frame. The radius is now a per-axis fraction of the hull extents (view-circular, capped below half a slot spacing) and dense traces are decimated to <=129 ring stations (measured 17 -> 62 fps at 128 traces x 256 bins)

  • Fixed the 3D view rotation being too fast and quantized to whole degrees: the mouse/keyboard handlers stored int(round(angle)) % 360, which discarded the sub degree motion of a slow drag (on a 2000 px wide widget a 1 px move is 0.09 degrees, so the scene did not move at all) and let the angle leave the canonical range; the gain was three full turns per drag across the widget (measured: 200 px -> 220 degrees). Angles are kept as doubles wrapped into [0, 360) and the default gain is half a turn per widget dimension (measured on the same drag: 36 degrees). Regression tests: tests/plot3d_rotation_test

  • Fixed the MinMax bucket downsampler (FilterPointsMinMaxLTTB, FilterPointsLTTB before the v7.5.0 rework) emitting phantom vertices for data with non-finite coordinates: the raw-pointer fast path pre-scanned only the y values with isnan, so a sample with NaN x could win a bucket extremum and be mapped to qRound(NaN) == 0 (a fake spike pinned to the left canvas edge), and +/-Inf y values passed the pre-scan into the SIMD path producing INT_MIN pixel coordinates. The pre-scan now rejects non-finite y values (!isfinite), bucket winners with a non-finite x are caught by a per-bucket post-check that recomputes the bucket with the scalar loop, and the scalar loop skips non-finite x/y samples - aligning the raw-pointer path with the generic sample() path. Index-based series (no raw x array) are unaffected. The pre-scan deliberately stays y-only: scanning x as well was measured to cost +11% frame time on 1M clean points (extra memory traffic). Regression tests: tests/nan_curve_test

  • Fixed qwtToPolylineFiltered (the FilterPoints/WeedOutPoints mapper path) returning a single-vertex polygon holding a NaN coordinate for all-NaN input: the first-non-NaN scan stopped at the last sample and wrote it unconditionally. All-NaN ranges now return an empty polygon, mirroring the early exit of the Quad path, so the "empty polygon == no data" convention holds for callers. Regression tests: tests/nan_curve_test

  • Fixed the Percentile whisker levels of QwtBoxStatisticsCalculator being exchanged: whiskerLower took the (100-c)-th percentile and whiskerUpper the c-th one, so any coefficient below 50 produced wl > wu, an invalid sample and every datum counted as an outlier (64/64 in the technical report's regression case). The levels now follow the coefficient (c = tail percentage, e.g. 5 for the 5th/95th percentiles), QwtBoxSample carries a mean field that the calculator fills and QwtPlotBoxChart draws its mean marker at it (it used to duplicate the median), and the vestigial instance interface (setWhiskerMethod()/setWhiskerCoefficient(), consumed by no calculation path) is removed. New tests/box_statistics_test

  • Fixed QwtClipper::clipCircle mapping a point above the center to 3*pi/2 on vertical tangents (the opposite of qwtPolar2Pos and of its own non-vertical branches), which returned pi too much whenever the center sat exactly on a vertical rectangle edge; the sweep also merges cutting points that coincide within a small angular tolerance (a circle through a rectangle corner is reported by both adjacent edges with a few ulp of difference) and classifies every angular segment on its own, removing the 1-ulp dependent "full circle vs. zero-length arcs" corner cases and the angles[1] out-of-bounds read for a single cutting point. New tests/clipper_test with directed cases and a brute-force cross check

  • Fixed the gl2ps vector export producing undefined surface colors: the feedback buffer records the fixed-function vertex color, which the GLSL render path never writes (fully transparent fills - invisible surfaces - on the machine of the original measurement, data-independent colors elsewhere). Qwt3DSurface, the coordinate-system grid/axis lines and the color legend now emit immediate-mode geometry with explicit per-vertex colors while the feedback replay is active (Qwt3DPlot::isVectorExportActive(), derived from the GL render mode), so PDF/SVG exports carry the data colors. New tests/plot3d_vector_export_test and the surface_export_check.cpp probe

  • Fixed the Qwt3DIO format registry comparing format strings case-sensitively while the raster keys are the lowercase names of QImageWriter (savePixmap(file, "PNG") failed silently - the official 3D example hit this); lookups, registrations and the saveVector/savePixmap format checks are case-insensitive now, unregistered formats produce a qWarning and the example derives the format from the file suffix. New tests/plot3d_io_test

  • Fixed the 3D lighting and material parameters being discarded: setLightComponent()/setMaterialComponent()/setShininess() store their arguments now and Qwt3DSurface uploads them as shader uniforms (light position from setLightRotation, per-component ambient/diffuse/specular, shininess); the defaults reproduce the previously hardcoded values pixel for pixel and illuminate()/blowout() switch the single light, so the 5 theme lighting presets finally differ. New getters and tests/plot3d_lighting_test

  • Fixed the matplotlib-sourced colormap presets carrying hand approximations: inferno/magma/turbo had their stops compressed into the first ~70% of the reference curve placed over the whole range and viridis/cividis deviated by up to 17 dE00. The stops are now sampled from the official matplotlib 256-entry tables at the preset positions (generator docs/assets/algorithms/colormap_stops_gen.py): stop deviation 0.000, whole-band deviation 0.445-1.380 dE00, inferno/magma grade A

  • Fixed QwtScaleDiv::setTicks() storing duplicated tick values (the date engine's qRound(i*minStep) collapse) and QwtAbstractScaleDraw::draw() painting coinciding ticks twice: the tick lists are sorted and deduplicated, and ticks sitting on a longer tick type are skipped, so every position is painted once with the longest length. New tests/scale_draw_test

  • Fixed two comments contradicting their implementations: QwtColorMapPreset::presetFromName() documents the fallback to Viridis (it never returned -1) and Qwt3DSurface::setResolution() documents the index stepping plus the full rebuild/re-upload it actually performs

  • Performance: moved the AVX2 argmin/argmax kernel into its own translation unit compiled with /arch:AVX2 (MSVC) / -mavx2 (GCC/Clang) via CMake (qwt_simd_argminmax_avx2.cpp). Compiled for the x86-64 baseline it mixed legacy SSE into its 256-bit epilogue and returned with a dirty upper YMM state - measured 446 ns of fixed overhead per call (n=16) and a 16x slowdown of scalar code following it in the same thread; after the split the call drops to 13.5 ns, the streaming penalty disappears and the MinMax bucket criterion collapses from ~481 to 4-8 elements. The dispatcher still calls it only after its CPUID check; the amalgamated build inlines the file as before

Documentation

  • New benchmark example examples/bench/chartbench and the four-way plotting library comparison report: the example drives Qwt, an in-tree QCustomPlot 2.1.0 copy and Qt Charts through one measurement protocol and pulls QIm in as a git submodule; eight suites (sample count, series count, canvas size, data handover vs. repaint, point reduction, frame-time distribution, process memory, startup cost) plus image export, one CSV pair per library and backend, and a driver script that runs the whole matrix. The protocol is part of the result - QOpenGLWidget defers a plain repaint() to Qt's composition step, so the report documents driving makeCurrent()/paintGL()/glFinish() instead (the naive protocol reports 0.004 ms for a 100k point curve), and the QCustomPlot copy carries the minimal Qt 6 Q_MOC_RUN/Q_NAMESPACE fix that upstream 2.1.1 has as well. 17 figures and 14 tables are regenerated by docs/assets/bench/chartbench_experiment.py from the raw CSVs; Qt Charts' OpenGL series path is reported as a measured negative result (no curve pixels in the framebuffer)

Don't miss a new QWT release

NewReleases is sending notifications on new releases.