Results 1 to 2 of 2

Thread: setting a custom scale

  1. #1
    Join Date
    Nov 2012
    Posts
    11
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default setting a custom scale

    Hi everybody !

    I want to use, on my bottom axis of a qwtPlot, a reciprocal scale and to be able to switch between the linear scale and the reciprocal (x' = A/x, where A = 12396000, with x in the range 2000 - 10000), and replot my curves.
    I have the idea that I must overload a QwtTransform class and use it in a qwtScaleEngine to get a correct display (both for the data and the axis scale graduations), but the whole picture is not clear to me.
    Could somebody outline the process for me ?

    Thanks in advance

    Oliver

  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: setting a custom scale

    Well. there is not so much to explain: YourTransform::transform is used for mapping a plot coordinate to a widget coordinate and YourTransform::invTransform for the other way round.
    The formula how these methods are used is given in the docs: http://qwt.sourceforge.net/class_qwt...m.html#details.

    The scaleengine example shows a couple of transformations f.e one that uses a different formula for a specific interval ( TransformPos in mainwindow.cpp ). Instead of the path, where pow is used you have to add your A/x code.

    Uwe

Similar Threads

  1. Replies: 5
    Last Post: 25th January 2021, 16:01
  2. Replies: 1
    Last Post: 9th September 2013, 07:50
  3. Axis won't stay at new scale setting
    By Maxicatten in forum Qwt
    Replies: 5
    Last Post: 9th April 2009, 04:03
  4. Setting scale proportion
    By KosyakOFF in forum Qwt
    Replies: 0
    Last Post: 8th May 2008, 05:28
  5. qwtscalewidget: setting scale to the widget..
    By halberdier83 in forum Qwt
    Replies: 3
    Last Post: 4th December 2007, 08:08

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.