- 373
- 0
- 约6.28万字
- 约 88页
- 2017-06-11 发布于湖北
- 举报
QCustomPlot Demo 范例
Plot Screenshots: Simple Demo// add two new graphs and set their look:customPlot-addGraph();customPlot-graph(0)-setPen(QPen(Qt::blue)); // line color blue for first graphcustomPlot-graph(0)-setBrush(QBrush(QColor(0, 0, 255, 20))); // first graph will be filled with translucent bluecustomPlot-addGraph();customPlot-graph(1)-setPen(QPen(Qt::red)); // line color red for second graph// generate some points of data (y0 for first, y1 for second graph):QVectordouble x(250), y0(250), y1(250);for(inti=0; i250; ++i){??x[i] = i;??y0[i] = qExp(-i/150.0)*qCos(i/10.0); // exponentially decaying cosine??y1[i] = qExp(-i/150.0);????????????? // exponential envelope}// configure right and top axis to show ticks but no labels:// (see QCPAxisRect::setupFullAxesBox for a quicker method to do this)customPlot-xAxis2-setVisible(true);customPlot-xAxis2-setTickLabels(false);customPlot-yAxis2-setVisible(true);customPlot-yAxis2-setTickLabels(false);// make left and bottom axes always transfer their ranges to right and top axes:connect(customPlot-xAxis, SIGNAL(rangeChanged(QCPRange)), customPlot-xAxis2, SLOT(setRange(QCPRange)));connect(customPlot-yAxis, SIGNAL(rangeChanged(QCPRange)), customPlot-yAxis2, SLOT(setRange(QCPRange)));// pass data points to graphs:customPlot-graph(0)-setData(x, y0);customPlot-graph(1)-setData(x, y1);// let the ranges scale themselves so graph 0 fits perfectly in the visible area:customPlot-graph(0)-rescaleAxes();// same thing for graph 1, but only enlarge ranges (in case graph 1 is smaller than graph 0):customPlot-graph(1)-rescaleAxes(true);// Note: we could have also just called customPlot-rescaleAxes(); instead// Allow user to drag axis ranges with mouse, zoom with mouse wheel and select graphs by clicking:customPlot-setInteractions(QCP::iRangeDrag| QCP::iRangeZoom| QCP::iSelectPlottables);Plot Screenshots: Sinc Scatter DemocustomPlot-legend-setVisible(true);customPlot-legend-setFont(QFont(Helvetica,9));// set locale to english, so we get english decimal separator:
您可能关注的文档
- PUCCH处理流程.ppt
- PUN双关的用法.ppt
- PS蒙版使用教程、快速蒙版、剪切蒙版、矢量蒙版、图层蒙版.doc
- PVC搪塑 聚氨酯喷涂成型表皮(PU SPRAY).docx
- PUMA台架1.4.1操作规程.doc
- PVD表面镀覆技术原理.ppt
- python_笔记.docx
- PWL37C维修手册.ppt
- PY=新闻点评=第6稿定稿.ppt
- ps绘图工具.ppt
- 25-26学年政治(部编版)选择性必修第二册课件:第1单元 周清1 民法中的人身权及财产权.pptx
- 25-26学年政治(部编版)选择性必修第二册课件:1.4.1 权利保障 于法有据.pptx
- 2025北京丰台区高二(上)期中地理(A卷)含答案.docx
- 2025北京三帆中学初三(上)开学考英语试题含答案.docx
- 2025北京一零一中初三9月月考语文试题含答案.docx
- 2025北京海淀区初三(上)期中道法试题含答案.docx
- 2025北京丰台区高一(上)期中政治(A卷)含答案.docx
- 25-26学年政治统编版必修4课件:3.3 唯物辩证法的实质与核心.pptx
- 25-26学年政治统编版必修4课件:7.2 正确认识中华传统文化.pptx
- 湖北省部分高中2026届高三上学期二模联考 历史试卷.docx
最近下载
- J B-T 8577-2015 内燃机水散热器技术条件.pdf VIP
- 王明新数学物理方程习题解答.pdf VIP
- 云网融合的多云网络架构.pdf VIP
- 20220301电缆行业SAP解决方案.pptx VIP
- 【精选】0深圳生态规划0深圳生态规划.pdf VIP
- KA_T 22.1-2024 矿山隐蔽致灾因素普查规范 第1部分:总则.docx VIP
- GDBD-2025-12 输变电工程环保水保监测与验收费用计列指导意见.pdf VIP
- 手把手教你做应付票据审计底稿.pdf VIP
- 《商务英语:职场进阶》教师用书 完整版.pdf VIP
- 深度:短期看新车型销量及FSD,中期看能源,长期看Optimus.pdf VIP
原创力文档

文档评论(0)