QCustomPlot Discussion and Comments

Minimum range on value axisReturn to overview

Hi guys,

I have adapted the real time plotting example to plot a continuous stream of data.

While I quite like the automatic scaling feature (and don't want to go over to a fixed range for the value axis), there's a problem for me. Occasionally the signal fluctuates around zero for quite some time and due to the autoscaling, the signal is 'blown up' across the entire axis. While this is physically correct, it is visually not very pleasing.

Is it possible to set a minimum range for the value axis?

Many thanks

How about this:

if (customPlot->yAxis->range().size() < 1.234)
  customPlot->yAxis->setRange(customPlot->yAxis->range().center(), 1.234, Qt::AlignCenter);

after the call to rescaleValueAxis() ?
(replace 1.234 with whatever minimum range size you want)

Thanks DerManu, this works like a charm!