Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7496717
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T18:45:14+00:00 2026-05-29T18:45:14+00:00

I want axis labels for a plot I’m making, and naturally the y-axis label

  • 0

I want axis labels for a plot I’m making, and naturally the y-axis label should be oriented vertically. I’m pretty sure QwtPlot does this, but I’m trying to keep things light so I’m just using a simple QWidget + QPainter for now. I didn’t see any way to change QLabel orientation in the documentation. Some solutions are given in this 2002 thread but I’d like something that doesn’t seem like such a hack. I’m using Qt 4.8 now, is there really no way to do this aside from QPainter::drawText()?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T18:45:15+00:00Added an answer on May 29, 2026 at 6:45 pm

    So indeed I gave up on finding any simple way to achieve this, and looking over Uwe Rathmann’s Qwt code indeed he uses QPainter::drawText() in his QwtPainter::drawText wrapper function, and a QTransform to achieve the rotation, in QwtScaleDraw::labelTransformation. So I’ve just put these together as follows:

    void LabelWidget::paintEvent(QPaintEvent*)
    {
        QPainter painter(this);
        painter.setPen(Qt::black);
        //... Need an appropriate call to painter.translate() for this to work properly
        painter.rotate(90);
        painter.drawText(QPoint(0,0), _text);
    }
    

    Didn’t need a QPixmap, it turns out.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to plot a barplot of some data with some x-axis labels but
I want the label of one of my axis to be two words, each
I want to plot a confusion matrix using Pylab. The class labels along the
I want to print an axis label: Temperature (℃). How do I do it?
I want to do the same like this here: matplotlib-share-x-axis-but-dont-show-x-axis-tick-labels-for-both-just-one set(plot,'visible','off') doesn't show any
I want to control the x and y axis of a multi series line
I want to scroll to a div + 100px in the y axis. How
How to scale the y-axis with Matplotlib ? I don't want to change the
I have a UIScrollView with a UIView inside. I want to lock the x-axis
I want to place two Time Series Charts sharing the same time domain axis

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.