二次方程式のグラフ(曲線フィッティング)を近似しようとしています。x 列と y 列を含む 4 つのデータ ファイルがあります。係数を決定し、各データ ファイルに対して各係数ファイルを書き込みます。
clk0_h clk0_h_c clk0_s clk0_s_c clk1_h clk1_h_c clk1_s clk1_s_c
c coefficient File (As of now I determie manually for generate Graph in python)
私が得たグラフは次のとおりです。
gnuplot コードは次のとおりです。
set title "Approximation Graph"
set term png
set output 'plot.png'
f(x) = a*x*x + b*x + c
fit f(x) 'clk0_h' via 'clk0_h_c'
fit f(x) 'clk1_h' via 'clk1_h_c'
fit f(x) 'clk0_s' via 'clk0_s_c'
fit f(x) 'clk1_s' via 'clk1_s_c'
plot "clk0_h" using 1:2 with lines, f(x), "clk1_h" using 1:2 with lines, f(x), "clk0_s" using 1:2 with lines, f(x), "clk1_s" using 1:2 with lines, f(x)
各線のグラフを近似しようとしています。しかし、混合または上書きされているようです。gnuplot を使用して次のグラフを作成する必要があります。元のグラフとはかけ離れています。しかし、gnuplot を使用して散布図を作成できます。
下のグラフでは、破線は近似を表します (サンプルは 2 つだけで表されます)。しかし、実際のグラフでは、4 つの近似線が必要です。
今日だけgnuplotを試しましたが、グラフも作成する必要があります。