我的直方图包含一些小值和一些非常大的值。如何将y轴分成两部分?
编辑:
gnuplot示例:
set style histogram columnstacked
set style data histograms
set key autotitle columnheader
plot for [i=2:6] 'test.dat' using i
TEST.DAT:
action device1 device2 device3
load 200 203 190 2 4
process 3 9 6 7 3
save 4 2 7 4 3
答案 0 :(得分:13)
我的回答是基于this website的示例和评论。从本质上讲,您正在寻找断开的y轴,可以使用multiplot
选项实现:
reset
unset key
bm = 0.15
lm = 0.12
rm = 0.95
gap = 0.03
size = 0.75
kk = 0.5 # relative height of bottom plot
y1 = 0.0; y2 = 15.0; y3 = 180.0; y4 = 220.0
set style histogram columnstacked
set style data histograms
set key autotitle columnheader
set style fill solid 1.0 border -1
set multiplot
set border 1+2+8
set xtics nomirror
set ytics nomirror
set lmargin at screen lm
set rmargin at screen rm
set bmargin at screen bm
set tmargin at screen bm + size * kk
set yrange [y1:y2]
plot for [i=2:6] 'test.dat' using i
unset xtics
unset xlabel
set border 2+4+8
set bmargin at screen bm + size * kk + gap
set tmargin at screen bm + size + gap
set yrange [y3:y4]
plot for [i=2:6] 'test.dat' using i
unset multiplot
备注:
multiplot
环境并设置下图(第4个块)。bm
,lm
,rm
,gap
,size
,{{1} }和kk
)这就是结果: