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()?
I want axis labels for a plot I’m making, and naturally the y-axis label
Share
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 hisQwtPainter::drawTextwrapper function, and aQTransformto achieve the rotation, inQwtScaleDraw::labelTransformation. So I’ve just put these together as follows:Didn’t need a QPixmap, it turns out.