Results 1 to 5 of 5

Thread: Change Label qwtpolarplot

  1. #1
    Join Date
    Mar 2016
    Posts
    7
    Qt products
    Qt5
    Platforms
    Windows

    Default Change Label qwtpolarplot

    I'm using a qwtpolarplot widget from 180 to -180, and I need that the widgets on the axes:

    360 -----------> 180
    270 -----------> -90
    180 -----------> -180
    90 -----------> 90

    how can I change this label?

    ImmaginePolarPlot.jpg

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

    Default Re: Change Label qwtpolarplot


  3. #3
    Join Date
    Mar 2016
    Posts
    7
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Change Label qwtpolarplot

    Thanks for your help...
    Another solution is the following:

    class AzimuthScaleDraw: public QwtRoundScaleDraw
    {
    public:
    virtual QwtText label( double value ) const
    {
    QwtText text;
    double valueReturn;

    if ((value>0) && (value < 180))
    {
    valueReturn = value;
    }
    else if ((value == 0) || (value ==360))
    {
    valueReturn = 180;
    }
    else if ((value == 180))
    {
    valueReturn = -180;
    }
    else
    {
    valueReturn = value -360;
    }
    return QwtRoundScaleDraw::label( valueReturn );
    }
    };

    and use:

    QwtPolarGrid *grid;

    grid->setAzimuthScaleDraw( new AzimuthScaleDraw() );


    what do you think about it ????

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

    Default Re: Change Label qwtpolarplot

    Well your code changes the labels, but not the transformation - so it depends on your data. If a point at -180 has to be displayed at 180 your code does it, if the coordinates of your data is intended to match the scales my proposal is better.

    Uwe

  5. #5
    Join Date
    Mar 2016
    Posts
    7
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Change Label qwtpolarplot

    Thanks...yes my code change only labels !!!! For transformer poin plot I used the example code qwt spectrogram !!!

Similar Threads

  1. Replies: 8
    Last Post: 1st July 2013, 13:20
  2. Change the size of pixmap in a label
    By metRo_ in forum Qt Programming
    Replies: 16
    Last Post: 1st June 2012, 11:21
  3. change label format
    By kpr in forum Qwt
    Replies: 0
    Last Post: 15th February 2011, 10:44
  4. how to change the direction label in combo box
    By Ratheendrans in forum Qt Programming
    Replies: 1
    Last Post: 29th November 2010, 07:57
  5. How to change the Label text
    By grsandeep85 in forum Qt Programming
    Replies: 2
    Last Post: 15th September 2009, 13:57

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.