Gnuplot 在绘制为直方图的数据上叠加高斯形状

Gnuplot 在绘制为直方图的数据上叠加高斯形状,gnuplot,histogram,gaussian,Gnuplot,Histogram,Gaussian,是否有人知道将高斯曲线叠加在直方图的不同区域上?我的目的是强调数据的趋势。谢谢卢西奥 我的数据(以%为单位并保存在hist.dat中)是: 绘制它的命令有: set boxwidth 0.75 absolute set style fill solid 1.00 border -1 set style data histogram set style histogram cluster gap 1 set ylabel "Count of structures (%)" set xlabel

是否有人知道将高斯曲线叠加在直方图的不同区域上?我的目的是强调数据的趋势。谢谢卢西奥

我的数据(以%为单位并保存在hist.dat中)是:

绘制它的命令有:

set boxwidth 0.75 absolute
set style fill solid 1.00 border -1
set style data histogram 
set style histogram cluster gap 1
set ylabel "Count of structures (%)"
set xlabel "Experimental methods"
plot 'hist.dat' using 2:xtic(1) title col, \
    '' using 3:xtic(1) title col, \
    '' using 4:xtic(1) title col, \
'' using 5:xtic(1) title col, \
    '' using 6:xtic(1) title col

您可以定义钟形曲线的函数:

f(x) = (1 / s * sqrt(2 * pi)) * exp(- ((x - m) / s)**2 / 2)
然后使用
fit
命令使其适合您的数据点:

fit f(x) 'hist.dat' using 3:1 via m, s
我认为您必须为此转换数据文件。无论如何,我觉得这更合理,因为我不会使用聚集直方图,而是使用多点图:

set multiplot layout 1,3
《gnuplot手册》(4.4版)第57章,第13章中的函数和表达式语法以及第75.40章中的
fit

set multiplot layout 1,3