Take the 2-minute tour ×
Signal Processing Stack Exchange is a question and answer site for practitioners of the art and science of signal, image and video processing. It's 100% free, no registration required.

I need to draw waveforms for biometric data like ECG and EEG signals. When I have more samples than pixels at the X-axis, I need to draw a vertical line between the MIN and MAX sample-value for that period.

Now I was wondering, suppose the signal is highly volatile, and the MAX for the next point is lower than the MIN from the previous point, there will be a 'gap' in the waveform.

What is the correct way to connect these points? When drawn using standard polyline routines the pen will draw from the last position (MAX) to the start of the new line (MIN), which is a much larger distance, causing the signal look thicker than it would be if I just connected the previous MIN to the new MAX (if the trend is downwards), or the previous MAX to the new MIN (if the trend is upwards).

Is there a standardized way to do this, or is it just a matter of taste?

share|improve this question

1 Answer 1

You can probably use "error bar plots" for this. Error bar plots are like regular 2-D plots, but you can specify vertical bars above and below each plotted point. See section 4.12, page 259, in this PDF document for many examples: http://pgfplots.sourceforge.net/pgfplots.pdf

Matlab also supports error plots, with the errorbar command.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.