- Java 双重比较
- java - 比较器与 Apache BeanComparator
- Objective-C 完成 block 导致额外的方法调用?
- database - RESTful URI 是否应该公开数据库主键?
使用 QT 的 QCustomPlot 插件。我不得不绘制可能非线性的点,因此图形可能看起来像这样
结果如何
但这是显示的内容
使用这段代码
plotter->addGraph();
plotter->graph(0)->setData(xVector, yVector);
plotter->xAxis->setLabel("X");
plotter->yAxis->setLabel("Y");
plotter->xAxis->setRange(x_data_range_min x_data_range_max);
plotter->yAxis->setRange(y_data_range_min, y_data_range_max);
plotter->replot();
plotter->saveJpg("test.jpg");
plotter->close();
现在我找到了一个部分修复方法,通过添加此选项来获取连接线并仅显示点,
plotter->graph(0)->setLineStyle((QCPGraph::LineStyle)QCPGraph::lsNone);
plotter->graph()->setScatterStyle(QCPScatterStyle(QCPScatterStyle::ssDisc , 3));
结果是这样,但有一个问题,它留下了一个我不能拥有的有点大胆的地方
所以这是一个半解决方案。所以我继续添加 A. Sarid 在下面的回复中提到的内容。我认为第一张图可能绘制得很好,但之后的任何其他图看起来都像这样
所以我不确定哪种解决方案只能使点按照从数组接收到的顺序连接
最佳答案
几天前我遇到了同样的问题。您需要使用 QCPCurve Class而不是图形。这是一个如何做到这一点的小例子:
this->newCurve = new QCPCurve(ui->customPlot->xAxis, ui->customPlot->yAxis);
ui->customPlot->addPlottable(this->newCurve);
然后您可以像使用图形一样使用它,例如:
this->newCurve->setData(x, y);
关于c++ - QCustomPlot 填充连接线,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36759136/
我有如下所示的文本文件: 1. SometextSometextSometextSometextSometext 2. SometextSometextSometextSometextSometext
这一章实现的连接线,目前仅支持直线连接,为了能够不影响原有的其它功能,尝试了2、3个实现思路,最终实测这个实现方式目前来说最为合适了。 请大家动动小手,给我一个免费的 Star 吧~ 大家
假设我的流是 x*N 行长,其中 x 是记录数,N 是每条记录的列数,并且按列输出。例如,x=2,N=3: 1 2 Alice Bob London New York 我如何加入每一行,以记录数为模,
如何在下面的 jsfiddle 中用虚线连接数字。 我希望这些线从内圈的边界开始,无论是来自 jQuery 还是来自 css。我的意思是围绕内圈的边界从内边界边缘开始到数字 ....... 1, ..
我正在使用 C#,但将来我可能需要在其他语言上使用它。 很多游戏都有这样的谜题。有一组电线(有两种类型的电线:直的和弯的。),有一个地方是信号进来的地方,还有一个地方是信号必须离开的地方。但是电线的布
本章响应小伙伴的反馈,除了算法自动画连接线(仍需优化完善),实现了可以手动绘制直线、折线连接线功能。 请大家动动小手,给我一个免费的 Star 吧~ 大家如果发现了 Bug,欢迎来提 Is
使用新版本的 Java 物质外观,不绘制典型 JTree 中的连接线(父子线)。 在 java.net 的官方论坛上有人问 same thing开发人员对此的回答是,这是基于较新的 UI 的选择,并且
我正在使用 matplotlib 绘制一些数据,这些数据需要一段时间,因此我必须使用 plot_date 来绘制我的线条。但出于某种原因,就连接线而言,Plot_Date 和 Plot 具有完全不同的
我是一名优秀的程序员,十分优秀!