#47 Automatically plot blank spaces for NaN & INF values in a waveform

open
nobody
None
5
2013-03-12
2013-03-12
Alketi
No

In some use-models, such as per-run data acquisition, it's a very common thing to have data with missing elements and to want to represent those as empty spaces on a plot.

Currently, to plot gaps or spaces in a waveform it appears that the user must subclass and begin overriding and customizing draw() methods.

http://www.qtcentre.org/threads/2175...urve-with-gaps
http://www.qtcentre.org/threads/3426...ervals-in-them
http://www.qtcentre.org/threads/4520...ues-in-qwtplot

For ease-of-use it would be highly desirable if this functionality was baked into Qwt.

I'd like to suggest a way to do it that already has industry acceptance and is easily understood by users.

Gnuplot, Plplot, and others simply translate "NaN" values into gaps in their curves. That way, if the user want's a blank spot, they just place NaN's in the correct array locations, which can be done easily during per-run data acquisition or in post-processing. They plot as normal, and gaps appear in the line segments at the correct locations.

+/-INF values should be treated the same way.

REFERENCES:

2.30 NaN / Inf support for some PLplot functions

Some PLplot functions now correctly handle Nan or Inf values in the data to be plotted.
Line plotting (plline etc) and image plotting (plimage, plimagefr) will
now ignore NaN / Inf values. Currently some of the contour plotting / 3-d
routines do not handle NaN / Inf values. This functionality will
depend on whether the language binding used supports NaN / Inf values.

GNUPLOT API
set datafile missing 'NaN'

Discussion