我想在图表中的每个条形上垂直添加诸如 200,300,600,800 等文本。这是我的代码。
set title font ", 25"
set xlabel "FEATURE LENGTH"
set xlabel font ",25"
set ylabel "ACCURACY(%)"
set yrange [45:76]
set ylabel font ",25"
set ytics font ", 25"
set boxwidth 0.98
set key spacing 3
set key font ",25"
set style fill pattern 10 border lt -1
set style histogram errorbars gap 1 lw 0
set key inside top center horizontal font "Helvetica, 25" width 1.8
set style histogram clustered #gap 5 title offset character 0, 0, 0
set xtics font ", 25"
set xtics ("F1" 0, "F2" 1, "F3" 2, "F4" 3, "F5" 4, "F6" 5, "F7" 6, "F8" 7, "F9" 8)
set style data histograms
plot "best_feature_pos.dat" using 1 t "{/Symbol a}", "" using 2 t "{/Symbol b}"
set output 'best_feature_pos10.eps'
set terminal postscript eps enhanced black
replot
这是我的数据文件
72.9 73.6
73.9 72.8
70.6 70.9
64 64
66 65.4
59 0
57.4 0
45.8 0
64.8 0
任何人都可以帮助我找到解决方案???
最佳答案
您可以使用 set label
将文本放置在您的绘图上,例如:
set label 1 '200' front at screen 0.15,0.5 rotate by 90 font "Arial,20"
set label 2 '300' front at screen 0.16,0.5 rotate by 90 font "Arial,20"
# etc.
这将需要一些手动调整才能将标签放在正确的位置。
关于ubuntu - 如何在 GNUPlot 图中的每个条上给出文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25097810/