QwtPlot Performance: HowTo plot a lot points?
Hi to everybody.
Are there any tricks to deal with a large amount of datapoint in QwtPlot? If I draw 500'000 points it takes a couple of time on every redraw.
I've tried the following without success:
Code:
myQwtPlot.
canvas()->setPaintAttribute
( QwtPlotCanvas::PaintCached,
false );
myQwtPlot.
canvas()->setPaintAttribute
( QwtPlotCanvas::PaintPacked,
false );
myQwtPlotCure.
setPaintAttribute( QwtPlotCurve::PaintFiltered,
true );
I've also added the zoom-implementation from the examples. If I click and move the mouse to position the rubberband for the zoom, the qwtPlot freezes for about 3 seconds!
I'm new in Qwt and don't see any way to solve the problem --> plese help me.
Thanks in advance
elDell
Re: QwtPlot Performance: HowTo plot a lot points?
Try:
Code:
myQwtPlotCure
->setPaintAttribute
( QwtPlotCurve::ClipPolygons,
true );
Uwe
Re: QwtPlot Performance: HowTo plot a lot points?
Unfortunately, this doesn't increase the performance:
Quote:
setPaintAttribute( QwtPlotCurve::ClipPolygons, true );
Any other tips?
elDell
Re: QwtPlot Performance: HowTo plot a lot points?
QwtPlotCurve::ClipPolygons improves the performance significant, for situations, where you zoom in and many points are outside of the visible area ( assuming you have a curve style, where your points are connected ).
For situations where all points are inside of the visible area you have to reduce the number of points you want to paint. It's obvious that 500000 points on a widget with 1000 pixels doesn't make too much sense. Reducing can be done by implementing different levels of detail - depending on the zoom level. ( f.e only every 10th point ).
You didn't write about the characteristics of your data. If your data isn't a series of points it might be better to use a different type of plot item.
Uwe
Re: QwtPlot Performance: HowTo plot a lot points?
Hi Uwe
Thanks a lot for your replay. Now I'm shure that there aren't any other qwt-options to improve performance --> I'm goning to reduce the points by writing my own filter!
Just for information, the points are all inside the visible area and I use a curve type with connected points.
Thanks a lot again
elDell