PDA

View Full Version : Zoomer behaviour



ccbaci
11th September 2013, 12:00
Is there a way to change the selection behaviour of the qwtzoomer ? I want to zoom only to one axis with a `line segment selection` (not with the rectangular rubber band). This is what MATLAB offers as shown in the figure attached. I already implemented the zoomer to work with yleft or xbottom only; however I couldn't find a way to select zoom region via a line segment.

Uwe
12th September 2013, 06:34
Isn't this a rectangular rubber band on the attached image ?

Uwe

ccbaci
13th September 2013, 11:45
Of course it is a rectangular rubber band. But MATLAB also offers line segment selection as it can be seen at the toolbar.

@Uwe, would you be kind enough to re-check this post, too

http://www.qtcentre.org/threads/55570-Plot-auto-scaling

Uwe
14th September 2013, 10:56
Well when you only have the left y axis you can simply do:


zoomer->setAxis( QwtPlot::xBottom, QwtPlot::yRight );Another option is to overload


virtual void zoom( const QRectF & );where you reset top/bottom to the current scale interval, calling the base class with the modified rect.

For the rubberband you can overload the drawRubberBand() method.

Uwe