Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/email/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何将用于生成直方图的频率计数从gnuplot导出到extern数据文件?_Gnuplot_Histogram - Fatal编程技术网

如何将用于生成直方图的频率计数从gnuplot导出到extern数据文件?

如何将用于生成直方图的频率计数从gnuplot导出到extern数据文件?,gnuplot,histogram,Gnuplot,Histogram,为了绘制柱状图,我遵循Gnuplot in Action一书,并使用 binc(bin_width,x) = bin_width * ( int(x/bin_width) + 0.5 ) 而我用的是 plot 'datafile' u (binc(bin_width,$1)) : (1.0/size_sample ) smooth frequency 我知道平滑频度为每个箱子创建一个频度计数,这被plot用来制作直方图 但是,如何创建包含频度的变量,我想这样做是为了将每个箱子的频度计数值导出

为了绘制柱状图,我遵循Gnuplot in Action一书,并使用

binc(bin_width,x) = bin_width * ( int(x/bin_width) + 0.5 )
而我用的是

plot 'datafile' u (binc(bin_width,$1)) : (1.0/size_sample ) smooth frequency
我知道平滑频度为每个箱子创建一个频度计数,这被plot用来制作直方图


但是,如何创建包含频度的变量,我想这样做是为了将每个箱子的频度计数值导出到一个文件,例如。

您可以通过设置
变量重定向绘图并以文本格式保存它

binc(bin_width,x) = bin_width * ( int(x/bin_width) + 0.5 )
set table "hist.dat"
plot 'datafile' u (binc(bin_width,$1)) : (1.0/size_sample ) smooth frequency
unset table
直方图将保存在文件名“hist.dat”中