PDA

View Full Version : Graph rotation



jomarin
13th August 2010, 13:52
Hello,

I have a QwtPlot that I would like to rotate like shown in the image below :

5072

The particularity is that the y axis in the rotated plot is with positive values on the left and the negative ones on the right.

I could simply rotate the QwtPlotCurve data but I don't see how to rotate the axes ?
I think the best way would be not to change the data, but to change the axes setting so that the QwtPlot Curves are plotted rotated ...

Any ideas ?

Thanks in advance,

Joel.

Uwe
13th August 2010, 17:22
How to invert the direction of an axis depends: if you are using QwtPlot::setAxisScale simply exchange the values for the min and max parameters. If you are using the autoscaler you have to enable the QwtScaleEngine::Inverted flag.

If you want to exchange x/y coordinates without copying your values I guess implementing your own QwtData bridge might be the easiest way.

Uwe

jomarin
16th August 2010, 09:21
Thanks Uwe, I tried and it works great ;)