Results 1 to 2 of 2

Thread: Plot Points from QwtPointArrayData with color according to Y Achsis

  1. #1
    Join Date
    Nov 2011
    Posts
    2
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Question Plot Points from QwtPointArrayData with color according to Y Achsis

    Hello

    I have a series of dataset that I'm trying to plot, which works just fine.

    Code looks kinda like this:

    Qt Code:
    1. QwtPointArrayData *zing;
    2. zing = new QwtPointArrayData(x,y);
    3.  
    4. QwtPlotCurve plotdata;
    5. plotdata.setStyle( QwtPlotCurve::Dots );
    6. plotdata.setData(zing);
    7.  
    8. plotdata.attach(qwtPlot);
    9. qwtPlot->replot();
    To copy to clipboard, switch view to plain text mode 

    works just fine...

    Now I'm trying to give the Points a Different Colors according to ther Y Values but have no clue how?!

    How could this be done?

    thanks
    Tk

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

    Default Re: Plot Points from QwtPointArrayData with color according to Y Achsis

    Use QwtPlotSpectroCurve and implement your own type of QwtSeriesData<QwtPoint3D> object, where you store your 2D point array only, but calculate the z value from the y value inside of YourData::sample().

    Uwe

Similar Threads

  1. Replies: 5
    Last Post: 17th June 2011, 17:53
  2. Editing points on QWt Plot
    By manmohan in forum Qwt
    Replies: 6
    Last Post: 14th May 2010, 07:43
  3. move/drag points on qwt plot
    By rambo83 in forum Qwt
    Replies: 5
    Last Post: 23rd November 2009, 08:36
  4. Labeling scatter plot points
    By hamid ghous in forum Qwt
    Replies: 1
    Last Post: 29th October 2009, 06:35
  5. Replies: 1
    Last Post: 2nd October 2008, 07:29

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.