Results 1 to 13 of 13

Thread: How to Change Curve Color when it out of scale

  1. #1
    Join Date
    Jun 2008
    Posts
    11
    Thanks
    3
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Question How to Change Curve Color when it out of scale

    How to change the curve color when the curve data out of the scale.
    e.g. I want the curve scale is 0-150, but some data of the curve is above 150 so I want it show from left again. like this:

    Untitled.jpg

    But Right now I just can plot like this:
    Untitled2.jpg

    I have no idea on how to change the color of part of the curve and to show the over range part like the first pic. I tried to set the CurveFilter , but it doesn't work! Do you have any ideas? Thank you!!

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

    Default Re: How to Change Curve Color when it out of scale

    What colors do you want to modify:


    • the fill color above/below a reference value
    • the line color above/below a reference value


    Uwe

  3. #3
    Join Date
    Jun 2008
    Posts
    11
    Thanks
    3
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: How to Change Curve Color when it out of scale

    I want to change the line color first.
    Because I still on the step to show all the curves ,
    the plan is going to add the fill function in the future.

    And another problem is when the curve data out of scale range, which will draws back, not smoothly ,
    like this:
    Untitled.jpg
    I want it just draw the over range part. Like the picture I show you in the post,
    but I got a idea to inherit another curve class to do it .

    With your great help (yours QWT lib), this is my project now:
    FileView-9.jpg
    Last edited by baoxuefei771; 19th June 2013 at 07:13.

  4. #4
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,291
    Thanked 876 Times in 824 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How to Change Curve Color when it out of scale

    These screenshots look very, very much like a plot I have written recently used in the drilling industry.

    I derived from QwtPlotCurve and implemented its individual scale as legend item. Then I had a special legend, where the user can resize and move each scale individually. This way it is possible to arrange plots with many scales.

    Usually the user is interested to see trends - the exact value is of less importance. That's why there is a mode I have called "wrapping", mapping a point modulo into the scale range. F.e for a scale of 100-200 a value of 310 would be mapped to 110. As my plot has to support QwtPlotCurve::Steps amd QwtPlotCurve::Lines I had to overload and reimplement both corresponding methods.

    If you want to do the same I strongly recommend to use Qwt 6.1: because of experiences with this project I introduced QwtPointMapper to avoid, that you have to copy much code for this type of specialization. Also the legend system is much more flexible.

    Uwe

  5. #5
    Join Date
    Jun 2008
    Posts
    11
    Thanks
    3
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: How to Change Curve Color when it out of scale

    Thanks for your reply.
    I am writing a program for wire line logging industry. It is a part of oil industry.
    I am a engineer of wire line logging , not a programmer, so it is a big challenge for me.
    Thanks for your good help.
    I will follow your idea to my project.

  6. #6
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,291
    Thanked 876 Times in 824 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How to Change Curve Color when it out of scale

    My application is also linked to the oil industry - this type of plots seems to be common in this area. Maybe I should do an example showing how to do it ...

    Uwe

  7. #7
    Join Date
    Jun 2008
    Posts
    11
    Thanks
    3
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: How to Change Curve Color when it out of scale

    That is a real good news for us!!
    Waiting for your news!!

  8. #8
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,291
    Thanked 876 Times in 824 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How to Change Curve Color when it out of scale

    Sorry this was not meant as that you can wait for seeing some code soon.

    Uwe

  9. #9
    Join Date
    Jun 2008
    Posts
    11
    Thanks
    3
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: How to Change Curve Color when it out of scale

    Got it.
    I just want to show you how expect I am.
    I will keep learning the qwt lib.
    Thank you again.

  10. #10
    Join Date
    Jul 2013
    Posts
    72
    Thanks
    1
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default Re: How to Change Curve Color when it out of scale

    Hi all ,I am very interested in this problem. Could you share some code or more details?

  11. #11
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,291
    Thanked 876 Times in 824 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How to Change Curve Color when it out of scale

    My implementation is working together with a closed source application, but I'm allowed to strip down the plotting part to something I can show as a Qwt example. This will happen somehow in the next weeks.

    Uwe

  12. #12
    Join Date
    Jul 2013
    Posts
    72
    Thanks
    1
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default Re: How to Change Curve Color when it out of scale

    Quote Originally Posted by Uwe View Post
    My implementation is working together with a closed source application, but I'm allowed to strip down the plotting part to something I can show as a Qwt example. This will happen somehow in the next weeks.

    Uwe

    Thank you very much. I can't wait to read that. Is it possible to see it before August ?

  13. #13
    Join Date
    Aug 2013
    Posts
    7
    Thanks
    2
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default Re: How to Change Curve Color when it out of scale

    Quote Originally Posted by Uwe View Post
    These screenshots look very, very much like a plot I have written recently used in the drilling industry.

    I derived from QwtPlotCurve and implemented its individual scale as legend item. Then I had a special legend, where the user can resize and move each scale individually. This way it is possible to arrange plots with many scales.

    Usually the user is interested to see trends - the exact value is of less importance. That's why there is a mode I have called "wrapping", mapping a point modulo into the scale range. F.e for a scale of 100-200 a value of 310 would be mapped to 110. As my plot has to support QwtPlotCurve::Steps amd QwtPlotCurve::Lines I had to overload and reimplement both corresponding methods.

    If you want to do the same I strongly recommend to use Qwt 6.1: because of experiences with this project I introduced QwtPointMapper to avoid, that you have to copy much code for this type of specialization. Also the legend system is much more flexible.

    Uwe
    That will be a good example which demostrates how powerful the QWT it is! +1
    Thank Uwe in advance!

Similar Threads

  1. How to scale a curve
    By phenoboy in forum Qwt
    Replies: 3
    Last Post: 8th April 2013, 19:31
  2. curve scale help needed
    By butlermog in forum Qwt
    Replies: 0
    Last Post: 13th July 2010, 14:40
  3. Replies: 4
    Last Post: 29th April 2010, 06:11
  4. Replies: 1
    Last Post: 22nd January 2010, 14:34
  5. Replies: 1
    Last Post: 23rd May 2008, 08:24

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.