gnuplot中的水平直方图 [英] Horizontal histogram in gnuplot

查看:98
本文介绍了gnuplot中的水平直方图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在gnuplot中绘制水平直方图.

这是我当前的直觉(通常是直方图)直方图:

width=0.5
hist(x,width)=width*floor(x/width)+width/2.0 
set boxwidth width*0.9
set style fill solid 0.5
plot "a" u (hist($2,width)):(1.0) smooth freq w boxes lc 3 notitle

现在我需要的是完全相同的结果,但顺时针旋转90度.

我在下面尝试过,但是结果确实不是我期望的.

width=0.5
hist(x,width)=width*floor(x/width)+width/2.0 
set boxwidth width*0.9
set style fill solid 0.5
plot "a" u (1.0):(hist($2,width)) smooth freq w boxes lc 3 notitle

解决方案

如果仅关注位图输出,则还可以使用此处中提供示例和更多详细信息. /p>

I am trying to plot a horizontal histogram in gnuplot.

This is my current vertival (usual kind) histogram:

width=0.5
hist(x,width)=width*floor(x/width)+width/2.0 
set boxwidth width*0.9
set style fill solid 0.5
plot "a" u (hist($2,width)):(1.0) smooth freq w boxes lc 3 notitle

Now what I need is the exact same result but rotated 90degrees clockwise.

I have tried this below but results are really not what I expect.

width=0.5
hist(x,width)=width*floor(x/width)+width/2.0 
set boxwidth width*0.9
set style fill solid 0.5
plot "a" u (1.0):(hist($2,width)) smooth freq w boxes lc 3 notitle

解决方案

If bitmap output is the sole concern, one can also employ the convert command of the ImageMagick suite after rendering the histogram with gnuplot.

convert -rotate 90 figure_in.png figure_out.png

Prior to doing this, rotate all labels within gnuplot with the rotate directive.

Examples and further details are provided here.

这篇关于gnuplot中的水平直方图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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