PDA

View Full Version : Lining up of plots in the same horizontal Layout



pari
1st June 2012, 07:24
I would like to know if there is way to line up more than one plots in the same horizontal layoutor attach more than one plot in the same horisontal layout.

Thanks,
Pari

sonulohani
4th June 2012, 13:26
plot or curve, if it is plot then make two object of QwtPlot and place it in the widget by using setGeometry().
And if you have to place two curve in one plot then, just make an array of QwtPlotCurve. The following example will give you a brief view on this:--->



QwtPlotCurve *curve[2];//The no. of curve you want to display on plot.
for(i=0;i<2;i++){
curve[i]=new QwtPlotCurve();
}
curve[0]->setPen(QPen(Qt::white,2,Qt::SolidLine));
curve[0]->setCurveAttribute(QwtPlotCurve::Fitted);
curve[0]->setRenderHint(QwtPlotItem::RenderAntialiased);
curve[1]->setRenderHint(QwtPlotItem::RenderAntialiased);
curve[0]->attach(this->plot);
curve[1]->setPen(QPen(Qt::white,2,Qt::SolidLine));
curve[1]->setCurveAttribute(QwtPlotCurve::Fitted);
curve[1]->attach(this->plot);


This is how you would make several curve on the graph.