标签在gnuplot中重叠

标签在gnuplot中重叠,plot,label,gnuplot,Plot,Label,Gnuplot,有一个数据文件,我想将标签添加到条形图中,但不幸的是,标签覆盖在第一个条形图上方,我无法确定如何为每个标签添加偏移: set xrange[0:30] set y2tics font "Arial,8" mirror #set y2tics rotate # rotating the y2ticks alongside with the y-axis set xtics font "Arial,6" #set datafile separator "\t" set boxwidth 0.5 ab

有一个数据文件,我想将标签添加到条形图中,但不幸的是,标签覆盖在第一个条形图上方,我无法确定如何为每个标签添加偏移:

set xrange[0:30]
set y2tics font "Arial,8" mirror
#set y2tics rotate # rotating the y2ticks alongside with the y-axis
set xtics font "Arial,6"
#set datafile separator "\t"
set boxwidth 0.5 absolute # balkengroesse
set bmargin 0.6
set tmargin 0
set lmargin 0.9
set rmargin 0
set title "RTF History Analysis" font"Arial,9"
set ylabel "Max RTF" font"Arial,9" noenhanced
#set xlabel "Timestamp" font"Arial,9" noenhanced
#set xtics rotate 90 # turn the text to the vertical position
set style data boxes  # boxplot
set style fill solid 0.5 noborder 
set multiplot layout 3,1 # 3x vertical 1x horizontal

set grid xtics y2tics
set logscale y
set grid my2tics
set yrange[0.001:6500]
set logscale y2
set my2tics 10
unset ytics
set format "10^{%L}"
set xtics rotate by 50 offset -4.5,-3.00
set format y
plot "history_file.txt" u 7:xticlabels(2) w boxes lc rgb"blue" notitle, \
     "history_file.txt" u 7:2:3 w labels rotate left font "Arial,6" lc rgb"blue" notitle

数据文件的一部分:

recipe.rcp  14-03-2017-12:10    top 0.00656997498323    0.0074438616489 rx  0.00791297772894
recipe.rcp  14-03-2017-15:55    cibasic 0.00665396222124    0.00770821200216    tx  0.00938002006172
recipe.rcp  14-03-2017-16:27    cibasic 0.00654659192121    0.00791088142395    tx/tx_  0.010395539525
recipe.rcp  15-03-2017-14:44    ci  0.0106795993772 0.0114679721169 top 0.0128018372288
recipe.rcp  15-03-2017-14:58    sens    0.0101868323628 0.011261329309  tx  0.0131594769347
试一试


绘制“数据”u 7:xticlabels(2)w框、“u(列(0)):(.5):3和标签

要将标签与框一起放置,请将所有标签放置在相同的高度(y=0.5)

要使标签跟随框的高度,请尝试


绘制“数据”u 7:xticlabels(2)w框、“u(列(0)):(0.01+$7):3和标签

看起来您的标签是日期/时间。你需要告诉gnuplot这个。通常是使用
set-xdata-time
,并使用
set-timemt
指定时间格式。但我想我需要(部分)你的数据文件来进一步帮助。谢谢你的帮助Philipp!这些标签表示日期和时间,但这些信息应被视为一个字符串。我通过脚本的顶层代码和部分数据文件扩展了这个问题。非常感谢你,李!请您解释一下,这个
(列(0)):(.5):3
语法是如何工作的?
列(0)
是数据点的编号。有关此列和其他“伪列”的详细信息,请键入
help pseudocol
。由于长方体打印没有x坐标信息,因此长方体仅按顺序打印,而不是1,2,3,。。。您需要绘制标签与相同的整数,以使它们与方框保持一致。我不理解标签图中的“u”子句
u7:2:3
会使第7列成为x坐标,等等,但这没有意义。