PDA

View Full Version : Fixed size axes



wim12
13th May 2009, 14:07
Hi,
the solution is probably very simple, but I cannot figure it out...
How can you set the size of an axis (or, of the plotting area)?
The reason is that I have 4 plots below each other, the y-as being time, and the x-as being 4 different units. I want the plots to be exactly aligned, even if the x-axes have different widths.
Any way I can do this?
Thanks a lot for any hint!
Wim

wim12
15th May 2009, 09:05
Hi,
maybe it's not clear enough what I mean. Here's a screenshot:

http://img13.imageshack.us/img13/281/fixedwidthaxes.png

What would be the best way to make all graphs the same width (so the time axes are nicely aligned)?

Thanks for any help!
Wim

daduda
15th May 2009, 10:27
Hi Wim,

there is a way to fix the scale of an axis.
Use: setAxisScale(AxisID, min, max)

But than there is no automatic scaling anymore.
If you want to rescale you have to do it by yourself.

If you want to set the axisscale to automatic mode you have to do:
setAxisAutoScale(AxisID)

And remember: After every change on the QwtPlot use the replot function!

I hope that will help you

daduda

Uwe
15th May 2009, 11:03
In the SVN repository of Qwt (trunk) you find a plotmatrix example, that shows how to align plots.

Uwe

wim12
15th May 2009, 12:37
Hi,
thanks a lot, the example pointed me in the right direction!

It can easily be solved with:
self.ui.myPlot.axisScaleDraw(QwtPlot.yLeft).setMin imumExtent(100)

Thanks!!
Wim