我需要使用箱形图和晶须图来可视化我拥有的一些数据,我想在GNUPLOT中进行处理。到目前为止,我已将数据转换为GNU绘图所需的数据。最小,第一四分位数,中位数,第三四分位数和最大值
这是我的数据:
#x min Q1 median q3 max width label
1 9.9 10.25 10.7 10.975 11.3 0.3 100
2 23.5 25.525 26.05 27.85 29.1 0.3 200
3 37.5 40.8 43.65 44.35 45.7 0.3 300
4 55 58.25 58.65 61.875 65.9 0.3 400
5 71.3 73.65 75.25 77.4 80.1 0.3 500
6 73.6 83.85 86.05 88.775 97.5 0.3 600
7 85.8 89.45 97.3 103.75 106 0.3 700
8 102 111 112 115.5 119 0.3 800
9 116 127 128 134 141 0.3 900
10 126 134 136 140.25 146 0.3 1000
11 144 149 152 156.25 165 0.3 1100
12 144 151.25 154 158 166 0.3 1200
13 138 157.25 159 162 171 0.3 1300
14 155 161.25 165.5 170 173 0.3 1400
15 158 171 172.5 177.5 182 0.3 1500
我已经在Excel中制作了这张图
但是我需要在同一张图片中包含更多图形,这是我在Excel中无法做到的。我一直在弄乱GNUPLOT几个小时,试图使用烛台,但是我得到的所有图表都是错误的!
我已将数据文件上传到DROPBOX https://dl.dropboxusercontent.com/u/12340447/data.txt
任何帮助是极大的赞赏!
编辑:
我可能应该包括我目前拥有的脚本
set bars 2.0
set style fill empty
plot 'data.txt' using 1:3:2:6:5:xticlabels(7) with candlesticks title 'Quartiles' whiskerbars, \
'' using 1:4:4:4:4 with candlesticks lt -1 notitle
这给出了输出
图片出了点问题:首先,标签有误。他们都说0.3,但这应该是箱线图的宽度。我还想从每个平均值中添加一条线(如excel中所示),并用点或十字或其他标记。.基本上,使其看起来更像Excel输出。
再次-非常感谢您的帮助!
标签是错误的,因为它们需要来自xticlabels(8)
数据的第8列。最后一行添加蓝线(lt 3
),菱形点(pt 13
)
set bars 2.0
set style fill empty
plot 'data.txt' using 1:3:2:6:5:xticlabels(8) with candlesticks title 'Quartiles' whiskerbars, \
'' using 1:4:4:4:4 with candlesticks lt -1 notitle, \
'' using 1:4 with linespoints lt 3 pt 13 notitle
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句