First you need to align the y axes.
int extent = plot1->axisWidget( yLeft )->scaleDraw()->extent( plot1->axisWidget( yLeft )->font() );
plot2->axisWidget( yLeft )->scaleDraw()->setMinimumExtent( extent );
plot2->setAxisScaleDiv( xBottom, plot1->axisScaleDiv( xBottom ) );
int extent = plot1->axisWidget( yLeft )->scaleDraw()->extent( plot1->axisWidget( yLeft )->font() );
plot2->axisWidget( yLeft )->scaleDraw()->setMinimumExtent( extent );
plot2->setAxisScaleDiv( xBottom, plot1->axisScaleDiv( xBottom ) );
To copy to clipboard, switch view to plain text mode
A scale widget emits a signal scaleDivChanged() whenever its scale has been modified.
Uwe
Bookmarks