当谷歌搜索“水平侏儒图条形图”时,我发现http://www.phyast.pitt.edu/~zov1/gnuplot/html/histogram.html的第一个结果是旋转(!)最后的条形图,看上去相当巴洛克。尽管如此,我还是尝试了这种方法,但是标签被切断了。

reset
$heights << EOD
dad 181
mom 170
son 100
daughter 60
EOD
set yrange [0:*] # start at zero, find max from the data
set boxwidth 0.5 # use a fixed width for boxes
unset key # turn off all titles
set style fill solid # solid color boxes
set colors podo
set xtic rotate by 90 scale 0
unset ytics
set y2tics rotate by 90
plot '$heights' using 0:2:($0+1):xtic(1) with boxes lc variable有没有更好的方法?
发布于 2020-07-11 21:20:50
您所指的链接来自大约。2009年。从那时起,侏儒情节就发展起来了。正如@Christoph所建议的,请查看help boxxyerror。
脚本:(编辑:使用boxxyerror的4列语法(即x:y:+/-dx:+/-dy)缩短)
### horizontal bar graph
reset session
$Data << EOD
dad 181
mom 170
son 100
daughter 60
EOD
set yrange [0:*] # start at zero, find max from the data
set style fill solid # solid color boxes
unset key # turn off all titles
myBoxWidth = 0.8
set offsets 0,0,0.5-myBoxWidth/2.,0.5
plot $Data using (0.5*$2):0:(0.5*$2):(myBoxWidth/2.):($0+1):ytic(1) with boxxy lc var
### end of script结果:

加法:
2:0:(0):2:($0-myBoxWidth/2.):($0+myBoxWidth/2.):($0+1):ytic(1)是什么意思?
看起来比现在复杂多了。检查help boxxyerror。从手册中:
6列:
x y xlow xhigh ylow yhigh
因此,总的来说:
boxwidth
0,检查help pseudocolumns,但这里不相关,(0)的意思是固定值为零<代码>H 227<代码>H 128从第2列<代码>H 229<代码><代码>H 130ylow ($0-myBoxWidth/2.),行号减去一半的($0+myBoxWidth/2.),行号加上boxwidth
($0+1)的一半加上... lc var:颜色取决于从1ytic(1):列1开始的行号,即由于某些原因(我不知道),gnuplot似乎仍然没有一个方便的水平直方图绘图样式,但至少它提供了这个boxxyerror解决方案。
https://stackoverflow.com/questions/62848395
复制相似问题