gnuplot-无法获取直方图-始终绘制正常函数

gnuplot-无法获取直方图-始终绘制正常函数,gnuplot,histogram,Gnuplot,Histogram,我想用原始数据绘制一个简单的直方图。也就是说,我有一个文件,其中有一列用于测试,我只是在那里放了1000个正态随机变量,这样我就可以得到一个很好的高斯直方图 我写道: reset set style data histogram set style histogram cluster plot newhistogram "A", "mydata" 但是我得到的只是函数本身,即不是x轴是箱子,它只是一个从0到1000的数字,就像我绘制数据文件本身一样。 如何创建正确的直方图 理论 要绘制直方图,

我想用原始数据绘制一个简单的直方图。也就是说,我有一个文件,其中有一列用于测试,我只是在那里放了1000个正态随机变量,这样我就可以得到一个很好的高斯直方图

我写道:

reset
set style data histogram
set style histogram cluster
plot newhistogram "A", "mydata"
但是我得到的只是函数本身,即不是x轴是箱子,它只是一个从0到1000的数字,就像我绘制数据文件本身一样。 如何创建正确的直方图

理论 要绘制直方图,您的数据需要如下设置:

<cluster name 1> <data 11> <data 12> ... <data 1n>
<cluster name 2> <data 21> <data 22> ... <data 2n>
...
<cluster name m> <data m1> <data m2> ... <data mn>
实例 Data.csv Gnuplot脚本 输出
谢谢你是说我不能用gnuplot从原始数据生成直方图?我必须先操纵它?因为我确实使用了histx的方法,width=width*floorx/width+width,它确实生成了一个直方图,但我现在需要在另一个旁边生成一个直方图…@对不起,我不能理解你的问题。你所说的原始数据是什么意思?你说一个挨着另一个是什么意思…?嗨。我的意思是,我以一个值列表为例,我从某种测量中获得数据,并希望生成一个类似于matlab的hist函数的直方图。我还希望能够将多个数据源放在与上图类似的同一个绘图中。@ido当您按照上面的示例操作时,您会得到什么?
set style data histogram
set style histogram cluster
set style fill solid 1.0   #<this only makes the histogram bars filled with a color
plot for [i = 2 : 6] "Data.csv" u i:xticlabel(1)
col1 0.7585169 0.9014084 0.0530081 0.5387650 0.3958664 0.7884399
col2 0.5492615 0.1042125 0.4758576 0.2488184 0.0039956 0.3210850
col3 0.4668526 0.6453222 0.1703792 0.0229689 0.7916639 0.6115277
set style data histogram
set style histogram cluster
set style fill solid 1.0

plot for [i = 2 : 6] "Data.csv" u i:xticlabel(1)