2015-05-05 164 views
1

創建於gnulot標籤讀取的gnuplot標籤的價值是相當簡單的是否有可能從一個文件

set label "<value>" at <x,y> ... 

但我想從文件中讀取一個標籤在gnuplot的價值。

文件中的線條看起來是這樣的:

... 
400 300 8 0.200214 1.00193 7.42157 8.623714 86.06 13.94 1.26 
800 600 1 0.2055 0.1938 34.9172 35.3165 98.86 1.14 1.00 
800 600 2 0.2066 1.5514 21.1664 22.9244 92.33 7.67 1.54 
800 600 4 0.2027 1.6316 14.9445 16.7788 89.06 10.94 2.10 
800 600 8 0.242 1.8385 12.7261 14.8066 85.94 14.06 2.38 
1024 768 1 0.2212 0.2217 55.1782 55.6211 99.20 0.80 1.00 
... 

我只是需要從第10列用作標籤的值。

是否有可能實現這樣的事情:

set label from <inputfile> <column_of_inputfile> <row_of_inputfile> ...

感謝您的任何幫助。

+1

是的,使用'標籤'繪圖樣式,請參閱。例如http://stackoverflow.com/q/15170696/2604213或http://stackoverflow.com/q/14608900/2604213 – Christoph

+0

非常感謝。有了這些資源,我能夠修復它。 – Neverland

回答

1

此解決方案爲我:

set title "800x600" 

set xlabel "Nodes [#]\n"   
set ylabel "Speedup" offset 2 
set xrange [-0.55:3.55] 
set yrange [0:5] 
set style data histograms   # plot boxes 
set boxwidth 0.75     # have a gap between the boxes 

plot 'inputfile.csv' every ::9::12 using 10:xtic(3) title "800x600" lc rgb "grey",\ 
     '' every ::9::12 using :10:10 with labels center offset 0,1 tc rgb "black" 

第一條情節主線確實在細節:inputfile的

  • 每:: 9 :: 12 =>情節主線9-12 。
  • 使用10:xtic(3) =>列號10的值指定數據直方圖的高度。第3列的值用於標記x軸。

第二條情節線將第9-12行的第10列的內容作爲中心方向標記在數據直方圖上方。

該圖像顯示結果。

Gnuplot result with labels obove boxes. The values come from the input file

相關問題