Gnuplot 语法错误“;数据块名称后面必须跟有<&书信电报;EODmarker“;
我是gnuplot的新手。我只想画一张我在维基百科上找到的图表:Gnuplot 语法错误“;数据块名称后面必须跟有<&书信电报;EODmarker“;,gnuplot,Gnuplot,我是gnuplot的新手。我只想画一张我在维基百科上找到的图表: 但是我得到了这个语法错误“数据块名后面必须跟同样的结果只能使用gnuplot来实现 N = 10 f = 1.0 - 2.0/(N + 1) total = 0 set print 'dema.data' do for [i=0:39:1]{ value = \ 2 * 100 * (1.0 - f) * (f**i) \ - 100 * (1.0 -
但是我得到了这个语法错误“数据块名后面必须跟同样的结果只能使用
gnuplot
来实现
N = 10
f = 1.0 - 2.0/(N + 1)
total = 0
set print 'dema.data'
do for [i=0:39:1]{
value = \
2 * 100 * (1.0 - f) * (f**i) \
- 100 * (1.0 - f) * (1.0 - f) * (i + 1.0) * (f**i)
print sprintf('%02d % .5f', i, value)
total = total + value
}
unset print
print sprintf('# total %g (should approach 100)', total)
要查看结果,我将使用链接中修改的gnuplot
代码
set terminal pngcairo size 800, 600
set output 'output.png'
set xrange [-0.5:39.5]
set xtics axis 5
set mxtics 5
set yrange [-4:35]
set format y "%.1f"
unset key
set style fill solid 1.0
set boxwidth 0.6 relative
plot "dema.data" with boxes
这就产生了。这段代码就是Perl,就像你在文章中的链接中提到的:“和由这段Perl创建的dema.data“非常感谢GRSousaJr,很好。由于我的研究需要比较不同的输入集,您能否提取用于数据计算的数学函数?这是一个非常具体的问题。也许我帮不了你。但您可以查看以下链接:、和。
set terminal pngcairo size 800, 600
set output 'output.png'
set xrange [-0.5:39.5]
set xtics axis 5
set mxtics 5
set yrange [-4:35]
set format y "%.1f"
unset key
set style fill solid 1.0
set boxwidth 0.6 relative
plot "dema.data" with boxes