Results 1 to 5 of 5

Thread: Y-Axis Textdirection

  1. #1
    Join Date
    Dec 2010
    Posts
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Y-Axis Textdirection

    Hallo,
    i have a 2D-Plot with two y-axis and would like to have the axis-text in the same direction for both axis'.
    I thought to do this with method:

    plot->setAxisLabelRotation (QwtPlot::yRight, rotationInDegree);

    But this didn't work. I also tried it with different values for rotationInDegree.
    Whats the problem?

    That's my code until now:

    plot = new Plot();
    plot->enableAxis(QwtPlot::yRight, true);

    QFont axisTextFont;
    axisTextFont.setBold(true);
    axisTextFont.setPixelSize(14);

    QwtText rightAxisText(QString("rechts"));
    rightAxisText.setColor(Qt::red);
    rightAxisText.setFont(axisTextFont);

    plot->setAxisTitle(QwtPlot::yRight, rightAxisText);
    plot->setAxisLabelRotation (QwtPlot::yRight, -180.0);

    plot->replot();



    thanks a lot for your help
    oldman

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

    Default Re: Y-Axis Textdirection

    QwtPlot::setAxisLabelRotation is for the tick labels only. Instead you have to do:

    Qt Code:
    1. plot->axisWidget( QwtPlot::yRight )->setLayoutFlag(QwtScaleWidget::TitleInverted, false);
    To copy to clipboard, switch view to plain text mode 

    Uwe

  3. #3
    Join Date
    Dec 2010
    Posts
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Y-Axis Textdirection

    Thank you Uwe for this information,
    but sorry i missed yesterday to mention that i use qwt version 5.1.1.
    In this version the method setLayoutFlag don't exist.

    So exist there another possibility??


    The program is not written by me so it is not easy to switch to a newer version of qwt.


    oldman

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

    Default Re: Y-Axis Textdirection

    No - all you can do is to patch your own version of Qwt.

    Uwe

  5. #5
    Join Date
    Dec 2010
    Posts
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Y-Axis Textdirection

    Hi Uwe,
    i switch to version 6.0.0-rc5.

    Wasn't difficult.




    oldman

Similar Threads

  1. Replies: 0
    Last Post: 9th August 2010, 10:46
  2. Axis with more labels
    By rakkar in forum Qwt
    Replies: 1
    Last Post: 11th October 2009, 09:26
  3. How to set which axis are shown?
    By Jeo_ in forum Qwt
    Replies: 1
    Last Post: 28th April 2009, 14:05
  4. qwt custom log axis
    By kpv in forum Qwt
    Replies: 1
    Last Post: 16th April 2009, 16:21
  5. Qwt - extra axis
    By steg90 in forum Qwt
    Replies: 2
    Last Post: 10th July 2007, 14:41

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
  •  
Qt is a trademark of The Qt Company.