-----------------------------------------------------------------基本设置
ui->qwtPlot->setCanvasBackground(Qt::white);//设置背景颜色
ui->qwtPlot->setAxisScale(QwtPlot::yLeft,-2,55,2);//设置y轴坐标
ui->qwtPlot->setAxisTitle(QwtPlot::yLeft,tr("速度(km/h)"));//设置y轴标题
ui->qwtPlot->setAxisTitle(QwtPlot::xBottom,tr("时间(s)"));//设置x轴标题
ui->qwtPlot->setAxisScale(QwtPlot::xBottom,0,195,1);//设置x轴坐标
//ui->qwtPlot->setAxisLabelAlignment(QwtPlot::xBottom,Qt::AlignHCenter);
//ui->qwtPlot->setAxisFont(QwtPlot::xBottom,QFont("Times",18,QFont::Bold));//设置坐标字体
//ui->qwtPlot->setAxisLabelRotation(QwtPlot::xBottom,90);
//ui->qwtPlot->setWindowTitle("aaaaaaaaaaaa");//设置qwt标题
-------------------------------------------------------------画线
QwtPlotCurve *curve = new QwtPlotCurve();//设置画曲线工具
urve->setPen( Qt::blue, 1 ,Qt::DotLine);//设置画笔颜色和线条样式
QPolygonF pointsh,pointsl,points;//绘制路径
curve->setSamples( points );
curve->setRenderHint(QwtPlotItem::RenderAntialiased,true);//抗锯齿渲染
curve->attach( ui->qwtPlot );
---------------------------------------------------------------
ui->qwtPlot->updateAxes();//通知坐标更新
ui->qwtPlot->replot();//重新绘制图线
------------------------------------------------------------------------网络资源,未验证
//增加网格
QwtPlotGrid *grid = new QwtPlotGrid;
grid->setMajPen(QPen(Qt::gray, 0, Qt::DotLine));
grid->attach(this);
//增加缩放功能
QwtPlotZoomer *pZoomer= new QwtPlotZoomer(canvas());
pZoomer->setRubberBandPen(QPen(Qt::red));
ui->qwtPlot->setCanvasBackground(Qt::white);//设置背景颜色
ui->qwtPlot->setAxisScale(QwtPlot::yLeft,-2,55,2);//设置y轴坐标
ui->qwtPlot->setAxisTitle(QwtPlot::yLeft,tr("速度(km/h)"));//设置y轴标题
ui->qwtPlot->setAxisTitle(QwtPlot::xBottom,tr("时间(s)"));//设置x轴标题
ui->qwtPlot->setAxisScale(QwtPlot::xBottom,0,195,1);//设置x轴坐标
//ui->qwtPlot->setAxisLabelAlignment(QwtPlot::xBottom,Qt::AlignHCenter);
//ui->qwtPlot->setAxisFont(QwtPlot::xBottom,QFont("Times",18,QFont::Bold));//设置坐标字体
//ui->qwtPlot->setAxisLabelRotation(QwtPlot::xBottom,90);
//ui->qwtPlot->setWindowTitle("aaaaaaaaaaaa");//设置qwt标题
-------------------------------------------------------------画线
QwtPlotCurve *curve = new QwtPlotCurve();//设置画曲线工具
urve->setPen( Qt::blue, 1 ,Qt::DotLine);//设置画笔颜色和线条样式
QPolygonF pointsh,pointsl,points;//绘制路径
curve->setSamples( points );
curve->setRenderHint(QwtPlotItem::RenderAntialiased,true);//抗锯齿渲染
curve->attach( ui->qwtPlot );
---------------------------------------------------------------
ui->qwtPlot->updateAxes();//通知坐标更新
ui->qwtPlot->replot();//重新绘制图线
------------------------------------------------------------------------网络资源,未验证
//增加网格
QwtPlotGrid *grid = new QwtPlotGrid;
grid->setMajPen(QPen(Qt::gray, 0, Qt::DotLine));
grid->attach(this);
//增加缩放功能
QwtPlotZoomer *pZoomer= new QwtPlotZoomer(canvas());
pZoomer->setRubberBandPen(QPen(Qt::red));