QCustomPlot使用之绘制散点图
一、QCustomPlot概述
简单概述:QCustomPlot是基于Qt封装的一个图形绘制库、可以绘制散点图、曲线图、柱状图等各种图形,并可以把各种图形导出为png、jpg等各种格式的图片,使用很方便,只有两个文件qcustomplot.h和qcustomplot.cpp,这两个文件直接加到工程中即可。需要说明的是这个库依赖Qt中的Qt5PrintSupport模块,使用时添加上该模块即可。
二、下载地址
QCustomPlot库下载:http://www.qcustomplot.com/index.php/download。

解压后里面有需要的说明文档、代码示例、源码等。
三、绘制散点图示例
1、效果图示例

2、代码示例
CustomPoltWidget::CustomPoltWidget(QWidget *parent)
: QWidget(parent)
{
ui.setupUi(this);
// 设置坐标范围、坐标名称
QCustomPlot *pCustomPlot = new QCustomPlot(this);
pCustomPlot->resize(this->width(), this->height());
pCustomPlot->xAxis->setRange(-180.00, 180.00);
pCustomP

最低0.47元/天 解锁文章
1433

被折叠的 条评论
为什么被折叠?



