如何在Gnuplot中创建类似Excel的平滑?

时间:2015-12-14 01:11:24

标签: graph gnuplot

我得到的数据有很多数据点,没有明确的等式或只适合很多spikey数据,我只是想连接所有这些并使用Gnuplot创建一个平滑的图形,但是没有什么可以使得绘图像那些由MS Excel制作的。如何创建类似Excel的平滑图?

我使用的Gnuplot设置:

set terminal postscript eps enhanced font "FreeSerif,14" size 3.0in,1.7in
set output 'fig4a.eps'
set encoding iso_8859_1
set border linewidth .5
set xlabel '{/FreeSerif-BoldItalics d} {/FreeSerif-Bold ({\305})}'
set ylabel '{/FreeSerif-Bold {/Symbol D}{/FreeSerif-Bold C}_q (e/V)}'
set xrange [-8:8]
set xtics -8,2,8
set mxtics 2
set yrange [0:0.3]
set ytics 0,0.1,0.3
set mytics 2
set key at 1.42,-0.24 reverse
set style line 1 linewidth 0.5
plot for [n=2:4] 'fig4a.dat' u 1:n smooth cspline frequency w lines ls 1    
replot
quit

这些是我的情节(设计有点不同,因为我仍在解决平滑问题) 高强 Excel smooth plot

Gnuplot(spline,cspline,mcspline(每个产生类似的输出)) enter image description here

一些选定的数据点

使用:plot' fig4a.dat' u 1:4光滑的cspline通知w行ls 1

输出: enter image description here

数据点:

-8.09808994 -3.53E-07
-7.99108994 -1.02E-05
-7.88508994 -0.000162606
-7.77908994 -0.001377785
-7.67308994 -0.00552213
-7.56708994 -0.00499697
-7.46108994 0.0326345
-7.35408994 0.1168893
-7.24808994 0.186241
-7.14208994 0.205997
-7.03608994 0.191836
-6.93008994 0.151735
-6.82308994 0.106245
-6.71708994 0.086542
-6.61108994 0.104821
-6.50508994 0.155378
-6.39908994 0.192769
-6.29208994 0.17085
-6.18608994 0.133063
-6.08008994 0.093566
-5.97408994 0.091761
-5.86808994 0.171249
-5.76108994 0.20373
-5.65508994 0.139635
-5.54908994 0.117342
-5.44308994 0.142744
-5.33708994 0.111295
-5.23008994 0.047449
-5.12408994 0.017428002
-5.01808994 0.025381005
-4.91208994 0.07760701
-4.80608994 0.177550019
-4.69908994 0.221490023
-4.59308994 0.130530012
-4.48708994 0.022438001
-4.38108994 -0.004862101
-4.27508994 0.022498
-4.16908994 0.079377
-4.06208994 0.14604
-3.95608994 0.19269
-3.85008994 0.19097
-3.74408994 0.125244
-3.63808994 0.05851
-3.53108994 0.053151
-3.42508994 0.063857
-3.31908994 0.05646
-3.21308994 0.05375
-3.10708994 0.06817
-3.00008994 0.081894
-2.89408994 0.070248
-2.78808994 0.055941
-2.68208994 0.0445004
-2.57608994 0.029018
-2.46908994 0.034651
-2.36308994 0.05154
-2.25708994 0.051322
-2.15108994 0.053645993
-2.04508994 0.079479713
-1.93808994 0.110223123
-1.83208994 0.12952024
-1.72608994 0.123183
-1.62008994 0.100336
-1.51408994 0.0878377
-1.40708994 0.08143
-1.30108994 0.11223
-1.19508994 0.167822
-1.08908994 0.157034
-0.98308994 0.107838
-0.87708994 0.09736
-0.77008994 0.10481
-0.66408994 0.12359
-0.55808994 0.17554
-0.45208994 0.21844
-0.34608994 0.20774
-0.23908994 0.169731
-0.13308994 0.143784
-0.02708994 0.134956
0.07891006  0.136358
0.18491006  0.115993
0.29191006  0.1022772
0.39791006  0.130636
0.50391006  0.137051
0.60991006  0.108013
0.71591006  0.108763
0.82291006  0.147532
0.92891006  0.1658
1.03491006  0.160103
1.14091006  0.1589476
1.24691006  0.1353571
1.35391006  0.09032325
1.45991006  0.05464951
1.56591006  0.03587591
1.67191006  0.031322905
1.77791006  0.021403117
1.88491006  0.00489071
1.99091006  0.002355969

1 个答案:

答案 0 :(得分:3)

您可以使用

设置要在样条曲线中显示的点数
set sample 1000