Results 1 to 6 of 6

Thread: set axis properties with sign(x)log|x|+1

  1. #1
    Join Date
    Sep 2015
    Posts
    13
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Question set axis properties with sign(x)log|x|+1

    Now I want set y axis's properties with sign(x)log(|x|+1) ,but i found QwtLogScaleEngine class only supports log(x).
    Should I inherit class QwtLogScaleEngine and overwrite function autoScale( ) and devideScale()?
    Thanks for your help.

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

    Default Re: set axis properties with sign(x)log|x|+1

    I guess you have to derive from QwtScaleEngine, but probably there will be code in the implementation of QwtLogScaleEngine you have to copy out to your class as well.

    I believe, that having a logarithmic scale engine, that is not limited to positive ranges would be a quite handy thing and I would like to
    have such a thing in the Qwt library itself. If you are motivated to work in this direction please contact me by Email.

    ciao,
    Uwe

  3. #3
    Join Date
    Sep 2015
    Posts
    13
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Smile Re: set axis properties with sign(x)log|x|+1

    Thanks for your reply.
    I will have a try and tell you the progress later.
    Last edited by yellowfisher; 2nd September 2015 at 02:38.

  4. #4
    Join Date
    Sep 2015
    Posts
    13
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: set axis properties with sign(x)log|x|+1

    Quote Originally Posted by Uwe View Post
    I guess you have to derive from QwtScaleEngine, but probably there will be code in the implementation of QwtLogScaleEngine you have to copy out to your class as well.

    I believe, that having a logarithmic scale engine, that is not limited to positive ranges would be a quite handy thing and I would like to
    have such a thing in the Qwt library itself. If you are motivated to work in this direction please contact me by Email.

    ciao,
    Uwe
    I have spent some time on this project and till now I haven't get clear with the source code write in QwtScaleEngine class.
    While I set
    Qt Code:
    1. autoScale(int maxNumSteps, double &x1, double &x2, double &stepSize) const
    To copy to clipboard, switch view to plain text mode 
    arguments x1 and x2 to negative numbers, then no curve will be plot. But I cant find where to remove this limit for negative range.
    I set
    Qt Code:
    1. linearInterval = linearInterval.limited(-LOG_MAX, LOG_MAX);
    To copy to clipboard, switch view to plain text mode 
    in derived class and it dose nothing.
    Appreciate your help.

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

    Default Re: set axis properties with sign(x)log|x|+1

    Start with the transformation - a class derived from QwtTransform - how to find the ticks or to align the scale boundaries is only the second step.

    Uwe

  6. #6
    Join Date
    Sep 2015
    Posts
    13
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: set axis properties with sign(x)log|x|+1

    Quote Originally Posted by Uwe View Post
    Start with the transformation - a class derived from QwtTransform - how to find the ticks or to align the scale boundaries is only the second step.

    Uwe
    I haven't work on this project for a long time since last reply.And recently I worked out something like this.The first picture is the data I set and it plots like the second picture.
    It only has one step-(1,100), I think It's better to get two steps-(1, 10) and (10, 100), but I don't know how to make it.
    tableData.jpg
    plot.jpg

Similar Threads

  1. Axis Title to axis label alignment
    By ROCKSTAR in forum Qwt
    Replies: 0
    Last Post: 5th February 2014, 12:47
  2. How to free sign my app ?
    By Sparkle24 in forum Qt for Embedded and Mobile
    Replies: 4
    Last Post: 21st August 2011, 23:25
  3. Replies: 9
    Last Post: 3rd May 2011, 21:21
  4. Replies: 0
    Last Post: 9th August 2010, 10:46
  5. Euro sign
    By dragon in forum Qt Programming
    Replies: 3
    Last Post: 8th September 2008, 19:58

Tags for this Thread

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.