Hi,
I'm looking for a way to align this three different plots so that they use the same x-axis (In the attached pictures you can see why it's not working).
When I set different titles for the y-axis, my y-axis aren't aligned anymore. I did it the same way it is realised in the plotmatrix example. is there a way to consider the title of the axis?
double maxExtent = 0;
const QList<QwtPlot *> Plots = this->findChildren<QwtPlot *>();
sd->setMinimumExtent( 0.0 );
const double extent = sd->extent( scaleWidget->font() );
if ( extent > maxExtent )
maxExtent = extent;
}
scaleWidget->scaleDraw()->setMinimumExtent( maxExtent );
}
double maxExtent = 0;
const QList<QwtPlot *> Plots = this->findChildren<QwtPlot *>();
foreach( QwtPlot *p, Plots ){
QwtScaleWidget *scaleWidget = p->axisWidget( QwtPlot::yLeft );
QwtScaleDraw *sd = scaleWidget->scaleDraw();
sd->setMinimumExtent( 0.0 );
const double extent = sd->extent( scaleWidget->font() );
if ( extent > maxExtent )
maxExtent = extent;
}
foreach( QwtPlot *p, Plots ){
QwtScaleWidget *scaleWidget = p->axisWidget( QwtPlot::yLeft );
scaleWidget->scaleDraw()->setMinimumExtent( maxExtent );
}
To copy to clipboard, switch view to plain text mode
Additionally I want the first plots height to be as big as possible and the others to have a minimum height. I already set vertical SizePolicy for the mainplot expanding and the others fixed.
The number of plots in my window differs but the first one is the main plot. Also the number of curves in the other plots can be different.
Bookmarks