簡體   English   中英

帶有標簽的gnuplot框

[英]gnuplot boxes with labels needed

我正在嘗試繪制一個簡單的gnuplot條形圖。 每個欄頂部都有標簽。

這是我的測試

279 2 10149
286 1 699999
295 3 14098

這是我的命令:

echo "set terminal dumb size 70,30; plot 'test.out' using 3:xtic(1) with boxes" | gnuplot

它畫一個盒子。 我還希望在每個標簽的頂部貼上標簽。

請幫忙 )

您必須with labels再次繪制數據。

為了獲得正確的x位置,您必須知道在您的繪圖命令中plot 'test.out' using 3:xtic(1) with boxesplot 'test.out' using 3:xtic(1) with boxes x位置隱式地作為行號。

另外,在繪制with labels圖形時with labels最好明確地格式化標簽字符串。 根據您的數據,僅使用一列可能會或可能不會奏效,並且會給出非常令人驚訝的結果。

因此,簡而言之:

plot 'test.out' using 0:3:xtic(1) with boxes,\
    '' using 0:3:(strcol(3)) with labels offset 0,1

這會將第3列的字符串內容繪制為位置(行號,第3列的值)處的標簽,並在y方向上偏移1個字符的高度。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM