我有一個巨大的問題。我想讓最佳擬合曲線很好地通過這些點。在gnuplot中我這樣嘗試。
f(x) = a*x**6 b*x**5 c*x**4 d*x**3 e*x**2 f*x g
擬合f(x) 'dihedral_energy_sorted.txt'通過a,b,c,d,e,f,g
繪制'dihedral_energy_sorted.txt' 'dihedral_energy_sorted. txt' with points pointtype 7 pointsize 2 lineecolor "red", 'dihedral_energy_sorted. txt' with lines lw 2 linecolor "red", f(x) with lines lw 2 linecolor "blue"。
我需要更好的東西。
我需要更好的東西,給我一個貫穿各點的線圖,并且更加平滑,而不僅僅是由線連接的點。
也許在excel或matplotlib中,我有一些可以幫助我的東西
我需要類似的東西。
這是來自第一個檔案的資料
-172.266 5.93362
-161.743 7.90223
-151.444 9.39198
-139.667 9.07427
-128.472 7.94997
-118.986 6.82431
-109.593 5.48811
-99.149 4.25969
-89.297 3.26822
-78.018 2.26675
-69.572 1.43405
-59.157 0.814157
-50.830 0.57777
-40.542 0.859919
-30.995 1.28429
-21.507 1.70913
-11.557 2.41328
-0.911 3.12653
9.526 3.97824
19.606 4.61242
29.856 5.27657
40.725 5.0631
51.336 3.71232
61.068 2.25515
70.685 1.25386
80.499 0.655369
90.433 0.332484
100.257 0.167369
110.170 0.156063
120.393 0
129.920 0.100962
140.245 0.258918
149.617 0.698804
158.873 1.52595
168.424 2.53915
178.232 4.08872
這是第二個檔案的資料
-172.266 106.470
-161.743 106.362
-151.444 105.361
-139.667 105.809
-128.472 108.023
-118.986 111.368
-109.593 115.765
-99.149 119.263
-89.297 121.257
-78.018 120.227
-69.572 118.617
-59.157 116.109
-50.830 115.423
-40.542 114.353
-30.995 113.756
-21.507 113.016
-11.557 112.750
-0.911 111.413
9.526 110.081
19.606 109.232
29.856 108.139
40.725 110.666
51.336 111.101
61.068 111.435
70.685 110.908
80.499 110.659
90.433 110.070
100.257 109.833
110.170 109.453
120.393 109.125
129.920 108.426
140.245 108.150
149.617 107.904
158.873 107.596
168.424 107.216
178.232 106.899
uj5u.com熱心網友回復:
根據SO-"規則",評論中沒有答案。這里有一個答案。檢查help smooth和splines中的一個選項。
在這個大量的點中,不同的splines選項并沒有太大的區別。
代碼:
### smooth slpines。
reset session
$Data <<EOD
-172.266 106.470[/span
-161.743 106.362[/span
-151.444105.361
-139.667 105.809[/span
-128.472 108.023[/span
-118.986 111.368[/span
-109.593 115.765[/span
-99.149119.263
-89.297 121.257[/span
-78.018 120.227[/span
-69.572 118.617[/span
-59.157 116.109[/span
-50.830115.423
-40.542 114.353[/span
-30.995 113.756[/span
-21.507113.016
-11.557112.750
-0.911 111.413.
9.526 110.081。
19.606 109.232[/span
29.856 108.139[/span
40.725 110.666[/span].
51.336 111.101[/span
61.068 111.435[/span
70.685 110.908[/span
80.499 110.659[/span].
90.433 110.070[/span].
100.257 109.833[/span
110.170 109.453[/span].
120.393 109.125[/span
129.920 108.426[/span
140.245 108.150[/span
149.617 107.904[/span
158.873 107.596[/span].
168.424 107.216[/span].
178.232 106.899[/span
觸發點
plot $Data u 1:2 w p pt 7 ti "Data" ,
''/span> u 1: 2 smooth csplines lc "red" ti "csplines"。
''/span> u 1: 2 smooth acsplines lc "green" ti "acsplines",
''/span> u 1: 2 smooth mcsplines lc "blue" ti "mcsplines".
### end of code
結果:
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/312369.html
標籤:
下一篇:如何獲得pandas條形圖的顏色




