带有 gnuplot-iostream 以及 X 和 Y 轴的 Gnuplot

问题描述 投票:0回答:1

当我将 gnuplot 与 C:\gnu est.txt 中的一个简单文件一起使用时,其中包含

1 1
2 4
3 9
4 16
5 25
6 36
7 49
8 64
9 81
10 100
11 121
12 144

从命令行启动

gnuplot
并运行后,我得到了我期望的图表。

plot 'C:\gnu\test.txt' with lines

所以这很好用。

我希望能够使用

gnuplot-iostream
来完成此操作,这样我可以控制 X 轴和 Y 轴上的内容。

大致类似于

Gnuplot gp; 

gp << "plot 'C:\\gnu\\test.txt' using 1:2 with lines";

gp << "plot '-' using 1:2 with lines";

gp.send1d(data with x and y axis); 

如果你明白我的意思。

我真的不明白在我看来很简单的事情。

gnuplot gnuplot-iostream
1个回答
0
投票

您忘记在命令末尾添加结束行字符,例如:

gp << "plot 'C:\\gnu\\test.txt' using 1:2 with lines\n";
© www.soinside.com 2019 - 2024. All rights reserved.