qt 画图 持续更新

cpp 复制代码
//    QCustomPlot *customPlot;
    const QVector<double> x = {0, 1, 2, 3, 4, 5};
    const QVector<double> y = {1, 1, 2, 2, 4, 4};
    customPlot = ui->ctp;
    customPlot->setOpenGl(true);
    customPlot->addGraph();
    customPlot->xAxis->setRange(0, 5);
    customPlot->yAxis->setRange(0, 5);
    customPlot->xAxis2->setRange(0, 5);
    customPlot->yAxis2->setRange(0, 5);
    customPlot->xAxis2->setVisible(true);
    customPlot->yAxis2->setVisible(true);
    customPlot->graph(0)->setData(x, y);
    customPlot->legend->setVisible(false);
    customPlot->graph(0)->setLineStyle(QCPGraph::LineStyle::lsLine);  // 设置线性
    //    customPlot->graph(0)->setName("TEST");
    //    customPlot->xAxis->setLabel("x");
    //    customPlot->yAxis->setLabel("y");
    //    customPlot->replot();
//    customPlot->setInteractions(QCP::iRangeDrag | QCP::iRangeZoom);
    customPlot->axisRect(0)->setRangeZoomFactor(0.9, 0.9); // x方向为1.2
    customPlot->setInteractions(QCP::iRangeZoom);

https://www.wenshushu.cn/f/ea09y2n6v8q

https://netcut.cn/1hvhuovht

https://wormhole.app/lXx8k#iose8rYXadDmTS6SjG0lpg

相关推荐
瀚高PG实验室几秒前
因磁盘IO性能低导致程序An I/O error 报错
java·jvm·数据库·瀚高数据库
好家伙VCC3 分钟前
**发散创新:基于FFmpeg的视频编码优化实践与实战代码解析**在现代多媒体系统中,
java·python·ffmpeg·音视频
SamDeepThinking4 分钟前
开篇词:6000万会员规模下,我们是怎么做秒杀系统的
java·后端·架构
qq_3422958216 分钟前
如何监控集群 interconnect_ping与traceroute验证心跳通畅
jvm·数据库·python
专注VB编程开发20年16 分钟前
VB6 Ado、Dao连接Access数据库哪个最快
数据库·dao·ado
whn197717 分钟前
为了测试性能,构造几个达梦慢sql
数据库·sql
程序员书虫19 分钟前
Spring 依赖注入一次讲透:`@Autowired`、`@Resource`、`@Qualifier`、`@Primary` 到底怎么选
java·后端·面试
qq_3422958219 分钟前
Go语言错误处理如何做_Go语言error错误处理教程【实用】
jvm·数据库·python
qq_3345635519 分钟前
如何在phpMyAdmin中执行多条SQL语句_分号分隔与批量执行解析
jvm·数据库·python
.柒宇.20 分钟前
Redis
数据库·redis·缓存