gnuplot直方图上Y轴和条之间的空间 [英] Space between Y axis and bar on gnuplot histogram

查看:57
本文介绍了gnuplot直方图上Y轴和条之间的空间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这样的gnuplot脚本:

I have gnuplot script like this:

set term pos eps
set style data histogram
set style histogram clustered gap 1
set grid y
set boxwidth 0.8 absolute
set style fill transparent solid 0.8 noborder
#set key outside right top vertical Left

#component stuff
set output 'eps/component.eps'
set title "Component in interesting Issues"
set xlabel "Components"
set xtics nomirror rotate by -270
plot 'dat/!component' using 2:xtic(1) t "Count" lc rgbcolor "blue" lt 1

和数据:

Cmp count
AM    167
NM    90
RM    83
JT    53
TT    51
RED   32
MAP   29
COMM  3
SX    6
HS    68

这是我的输出:

我看到我的图表在Y轴和第一个条形图之间有较长的间隔.我怎样才能将这些条均匀地摊开?

I see my graph has long spaces between the Y axis and the first bar. How can I spread the bars out evenly?

推荐答案

gnuplot被数据文件中的第一行(应该是标头)弄糊涂了.只需用every ::1跳过这一行,自动缩放就可以了:

gnuplot gets confused by the first line in your data file, which is supposed to be the header. Just skip this line with every ::1 and the autoscaling is fine:

plot 'dat/!component' using 2:xtic(1) every ::1 t "Count" lc rgbcolor "blue" lt 1

4.6.4的结果:

通常,您无需为此类数据使用直方图,绘图样式with boxes也可以正常工作.

In general you don't need to use histograms for this kind of data, the plotting style with boxes also works fine.

这篇关于gnuplot直方图上Y轴和条之间的空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆