如何使用我的C程序绘制图形

如何使用我的C程序绘制图形,c,system,C,System,我的问题是我无法从我的c程序中绘制图形 当我搜索StackOverflow和google时,我得到了以下声明: system(“gnuplot-p-e\”plot'C:/Users/Ashfaaq Muhammad Dam/Desktop/New folder(3)/myfile.txt'\” 但问题是,终端显示的Gnuplot未被识别为内部或外部命令。 //节目开始 #include <stdio.h> #include <conio.h>\ #include &

我的问题是我无法从我的c程序中绘制图形

当我搜索StackOverflow和google时,我得到了以下声明:

system(“gnuplot-p-e\”plot'C:/Users/Ashfaaq Muhammad Dam/Desktop/New folder(3)/myfile.txt'\”

但问题是,终端显示的
Gnuplot未被识别为内部或外部命令。

//节目开始

 #include <stdio.h>
 #include <conio.h>\
 #include <stdlib.h>

int main()
{       
        int j;   
        int i;  

printf("Enter how many coordinates you want to input:\n");
scanf("%d", &j);

int x[j];
int y[j];

 for(i=0; i<j; i++)
   {      
       printf("Enter your x and y coordinate:\n");        
       scanf("%d %d", &x[i], &y[i]);

   }

   freopen("myfile.txt", "w", stdout);

   for(i=0; i<j; i++)        
   {    
       printf("\n%d %d\n", x[i], y[i]);

   }
system("gnuplot -p -e \"plot 'C:/Users/Ashfaaq Muhammad Dam/Desktop/New folder (3)/myfile.txt'\"");


system("pause");

return 0;
}
#包括
#包括\
#包括
int main()
{       
int j;
int i;
printf(“输入要输入的坐标数:\n”);
scanf(“%d”和“&j”);
int x[j];
int y[j];

对于(i=0;i直接从终端提示符运行时是否找到
gnuplot

gnuplot
未安装或不在您的路径中


一个简单的解决方案是使用
which gnuplot
find/-name gnuplot-type f
找到它的位置,并在
系统
字符串参数中使用绝对路径。

我认为您需要在系统中安装
gnuplot
。试试看

sudo apt-get install gnuplot-nox


你需要安装gnuplot你安装了吗?
gnuplot
?我运行我的c程序后,会保存一个txt文件。如果我使用gnuplot在txt文件中绘制坐标,则会绘制点。但是我希望我的程序在用户多次插入坐标后直接绘制坐标。实际上,我没有在路径中插入坐标。
sudo apt-get install gnuplot-qt
sudo apt-get install gnuplot-x11