Results 1 to 3 of 3

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

  1. #1
    Join Date
    Feb 2008
    Posts
    74
    Thanks
    31
    Thanked 2 Times in 2 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Question [Please Help]->Can't we draw different curves with same QwtPlotCurve object ?

    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.
    Attached Images Attached Images
    Last edited by Krish; 10th April 2008 at 15:27.

  2. #2
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,258
    Thanked 862 Times in 811 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: [Please Help]->Can't we draw different curves with same QwtPlotCurve object ?

    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.

    Uwe

  3. #3
    Join Date
    Feb 2008
    Posts
    74
    Thanks
    31
    Thanked 2 Times in 2 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Thumbs up [Solved]->Can't we draw different curves with same QwtPlotCurve object ?

    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

Similar Threads

  1. Replies: 2
    Last Post: 18th March 2008, 12:47
  2. Replies: 5
    Last Post: 11th March 2008, 14:38

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.