我知道gnu圖形是一個相當不錯的工具,並且有很多功能,但我只需要它繪製一個簡單的X和Y圖形,並提供數據值通過從C程序管道需要幫助繪製使用gnuplot通過C管道的最簡單的x,y圖形
在這裏,我寫了一個簡單的程序來繪製一些價值,它在一些系統中工作正常,但它不是在我的工作!
是的,我確實在我的Ubuntu的安裝gnuplot的一個小時前apt-get的,還沒有圖形彈出該程序執行後,請幫我做這工作,需要的是simple..thank你
這裏是我的代碼:
#include<stdio.h>
int main()
{
FILE *p = popen("gnuplot -persist","w");
fprintf(p,"plot 'data.dat' with linespoints\n");
fprintf(p,"%d\t%d\n",100,200);
fprintf(p,"%d\t%d\n",200,400);
fprintf(p,"%d\t%d\n",300,600);
fprintf(p,"e\n");
fclose(p);
return 0;
}
你想在C代碼中繪製文件'data.dat'或你傳遞給gnuplot的數字嗎? – 2015-02-11 14:14:26
我想繪製我穿過管道的數字.. – 2015-02-16 12:58:32