PDA

View Full Version : QwtPlot: how to auto-scale two Y scales?



paradiza
21st September 2007, 21:28
Hi guys,

I just tried Qwt for my 2D plots and it's really nice! However, there's some small issue I'm not able to figure out looking at the Qwt's docs:

When I have two Y-scales (left/right, for two curves) in one plot, the automatic linear scaling seems to combine the two data sets (curves) to determine the first Y-scale's range whilst the second Y-scale's range seems to be completely unrelated to the data...

Is there a nice way to use Qwt's scaling engine to auto-adjust the first Y-scale based on the first curve's data, and the second Y-scale based on the second curve's data? If so, does it also line up the major ticks on the left and right scale in order to share a common QwtPlotGrid?

Thanks,
para

Uwe
23rd September 2007, 12:18
Guess you attached both curves to xBottom/yLeft ?

Uwe

paradiza
23rd September 2007, 12:40
Yep, is there a way to attach a curve to an axis explicitly? :o

Edit: I guess you mean QwtPlotItem::setAxis(int xAxis, int yAxis)

Damn it,
para the blind :cool:

Vincenzo
22nd March 2009, 02:00
itt doesn't work for me!!! :(
... i can attach only two axis, one x and one y, but what should i do if i want attach two x axis, and two y axis?

effendi
24th March 2009, 02:28
I got a similar problem.

With help of the realtime_plot example I created a scroll- and zoomable QwtPlot.

I attached yLeft/xBottom to one Zoomer and created another one for yRight/XTop.
After dissabling the Tracker and the RubberBand for the second Zoomer everything is working fine.

But now I got 4 scrollbars, moving either the one or the other curve seperatly. Would it somehow be possible to synchronize those Scrollbars, so that zooming and scrolling both curves synchron (like zooming and scrolling the canvas they're on)

Thanks for your help in advance!