PDA

View Full Version : how to use qwtplotzoomer to zoom only one axis?



Abderrahim
8th January 2016, 09:55
I want use QwtPlotZoomer to zoom only X-axis, and leave Y-Axis fixed, Or to zoom Y-axis, and leave X-Axis fixed.
any idea how to do this?
Thanks.

Abderrahim

Uwe
8th January 2016, 11:32
If you are using only one x and one y axis you could assign the unused opposite one. F.e when using xBottom/yLeft and you want to zoom yLeft only you would do:


zoomer->setAxes( QwtPlot::xTop, QwtPlot::yLeft );If your situation is more complicated you might have to overload QwtPlotZoomer::rescale( const QRectF & ), by adjusting a copy of the code you find in qwt_plot_zoomer.cpp.

Uwe

Abderrahim
8th January 2016, 20:50
Many thanks Uwe,
My Plot has more y axis and one x-axis. I think your second proposal is the best way for my problem .
Nice weekend
Abderrahim

Abderrahim
11th January 2016, 12:23
Hello Uwe,
please help me with an example to use qwtplotzoomer for a plot with more one y-axis (y-multi-axis).

Uwe
12th January 2016, 07:36
You have to use several zoomers, but only one of them with a rubberband. F.e like in the bode example.

Uwe