View Full Version : [Please Help]->Can't we draw different curves with same QwtPlotCurve object ?

10th April 2008, 11:07
Hello! Friends,
I am using Qt4 and qwt in Windows. Now in my application i change the array to be attached to the curve according to the user requirements and then try plotting them. I get the plot but not properly drawn. You can see the screen shot attached.

Here at the first i drew cosine wave, then cleared the plot with qwtplot->clear(), then drew sine wave with the same QwtPlotCurve object. But you can see qwtplot remembers its previous curves as it has joined the end of cosine wave to the start of sine wave.

Also i tried to draw the same curve again and again it joins both the ends of the curve. Everytime i replot the qwtplot it draws the previous and the new curve.

I tried the same with different QwtPlotCurve object's in different slots, it works fine. But here i have only 2 waves, but in real application i will have many and the number depends on the user. So how can i dynamically create new objects with different name in the slot whenever its called?

Can anyone please help me out in this.I will be thankful:)

Thanks in advance.

11th April 2008, 09:03
QwtPlotCurve represents a set of x/y samples. If you want to display more than one set - or the same set in different ways use different QwtPlotCurve objects.

Also note, that QwtData is only a interface, but you are completely free how to organize your data. F.e. a QwtData object can also be a calculation ( like in the simple example ) without any storage.


14th April 2008, 11:03
Hello! Uwe,
Thanks for taking out time and replying me. I knew all those stuff's but i was a bit confused how to tackle my problem. But now am able to solve my problem.

Thanks again & Best Regards:)