GnuPlot 无法读取编译的 C 代码生成的数据(在 Windows 10 电脑上)。
这是我的(大大简化用于测试)数据文件“data1”
0.0000e+00 0.0000e+00
5.0000e-01 2.5000e-01
这是由
制作的#include <stdio.h>
void main()
{
double x=0.0 , y=0.0;
printf("%.4e %.4e\n",x,y);
x=0.5; y=x*x;
printf("%.4e %.4e\n",x,y);
}
在 Visual Studio Code 1.84.2(使用 gcc 的 MSYS2 版本 12.2.0)上编译成我称之为“SPAM”的可执行文件。在 Windows power shell 的该目录中,我调用
.\SPAM > data1
。
使用 GnuPlot 5.4(补丁级别 8)给我带来了这个麻烦:
gnuplot> plot 'data1'
^
Bad data on line 1 of file data1
直接使用
plot '-'
输入这些数据效果很好。
使用Notepad++查看数据文件没有显示隐藏或特殊字符。
将数据文件的内容复制粘贴到新文件中即可解决问题!
但我不能复制我的所有(实际上巨大)数据文件。
问题: