2012-05-24 136 views
0

我已經閱讀了許多論壇的主題,但還沒有找到我的答案呢。gnuplot tics繪製在圖

問題是,GNUPLOT正在繪製我的xtics,這是在我的數據文件中,但我不需要... 我通過管道從C調用gnuplot。 我已經張貼在nabble同樣的問題,但我需要儘快回答,因爲更多鈔票:)

void plotBox(FILE *pipe) 
{ 
    fprintf(pipe, "set grid\n"); // show grid 
    fprintf(pipe, "set boxwidth 0.9 relative\n"); 
    fprintf(pipe, "set style fill solid 1.00 border lt -1\n"); 
    fprintf(pipe, "set key outside right top vertical\n"); // show legend 
    fprintf(pipe, "set style data histograms\n"); // plot data in histograms 
    fprintf(pipe, "set style histogram clustered\n"); 
    fprintf(pipe, "set datafile missing '-'\n"); 
    fprintf(pipe, "set ytics 0,1\n"); 
    fprintf(pipe, "set xtics border in scale 0,0 nomirror rotate by -45 autojustify\n"); 
    fprintf(pipe, "set xtics norangelimit font ',13'\n"); 
    fprintf(pipe, "set xtics ()\n"); 
    fprintf(pipe, "set title 'boxiishi' \n"); 
    fprintf(pipe, "plot 'data.d' using 1:xtic(1) t col, '' u 2 ti col, '' u 3 ti col, '' u 4 ti col\n"); 
} 

這是我得到: http://dl.dropbox.com/u/43516417/histogram.jpg

+0

我很困惑,你的情節沒有xtics。你想在xtics上沒有標籤嗎? – mgilson

回答

0

我不知道你想要什麼。您顯示的情節沒有xtics(x軸上的小垂直tic標記)。這是通過set xtics scale 0,0完成的。如果你不想要標籤的位置,你可以做set xtics format '' - 或者甚至unset xtics。當然,與plot 'data.d' using 1:xtic(1) t col - 特別是xtic(1)部分的內容完全矛盾 - 「我的數據文件的第1列中包含字符串,並將它們作爲我的x-tics的標籤」..你能改述一下你的問題,使它更清楚你發佈的情節出了什麼問題嗎?