如何将用于生成直方图的频率计数从gnuplot导出到extern数据文件?
为了绘制柱状图,我遵循Gnuplot in Action一书,并使用如何将用于生成直方图的频率计数从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用来制作直方图 但是,如何创建包含频度的变量,我想这样做是为了将每个箱子的频度计数值导出
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”中