qwtplot

-----------------------------------------------------------------基本设置    
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)); 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值