Polyline simplifications

This technique is a nice example of an algorithmic improvement applied to a graphic. The idea is to simplify the displayed diagram by omitting some points and lines, while maintaining a good approximation of the general shape of the curve. Such techniques are known as polyline simplification, and there are a couple of algorithms implementing this idea, such as Douglas–Peucker or Visvalingam's algorithm.

One often-employed simplification method that is, for example, used by the popular LabView scientific software, is the so-called max-min decimation. Its main idea is illustrated here:

As we can see, the curve segments are replaced by bars, whose height is determined by the minimal and maximal value of the curve in a given interval preserving its rough outline. If we don't want to implement this algorithm by ourselves, the popular Qt Widgets for Technical Applications (QWT) library (http://qwt.sourceforge.net/) will use a similar technique for QwtPlotCurve::Lines, when the QwtPlotCurve::FilterPointsAggressive flag is set for plotting (since Qwt 6.2).

The official QWT site only provides the 6.1 version of the library, and this version only supports QwtPlotCurve::FilterPoints! The unofficial 6.2 version seems to be the current SVN trunk code base. Fortunately, there are some GitHub repositories providing the SVN trunk code, such as this one: https://github.com/svn2github/Qwt_trunk.