gnuplot - gnuplot 拟合扩展了分配的点。如何解决这个错误?
问题描述
我有 2 组数据文件
#veff S Pmax S Pmin
0.10 103 0.2135 152 -0.0505
0.11 104 0.2162 152 -0.0592
0.12 105 0.2177 152 -0.0669
和
#veff S Pmax S Pmin
0.13 106 0.2177 152 -0.0729
0.14 105 0.2162 152 -0.0778
0.15 105 0.2127 152 -0.0819
0.16 105 0.2078 152 -0.0858
0.17 105 0.2018 153 -0.0879
0.18 104 0.1959 153 -0.0889
0.19 104 0.1907 153 -0.0898
0.20 103 0.1860 153 -0.0921
虽然我尝试拟合拟合超出了代码的要点
set terminal wxt
#set term postscript eps color enhanced
#set output "1.eps"
set xlabel "Pmax"
set ylabel "Pmin"
[![enter image description here][1]][1]
set title "Pmax vs Pmin"
unset key
FIT_LIMIT = 1e-6
f1(x)=a1*x*x+b1*x+c1
f2(x)=a2*x*x+b2*x+c2
fit [x=0.185:0.218] f1(x) "PmaxPminVEFF.txt" u 3:5 via a1,b1,c1
fit [x=0.212:0.218] f2(x) "PmaxPminVEFF1.txt" u 3:5 via a2,b2,c2
plot 'PmaxPminVEFF.txt' using 3:5 with p pt 7,f1(x) lc rgb "red",\
'PmaxPminVEFF1.txt' using 3:5 with p pt 8, f2(x) lc rgb "green"
拟合线超出点。帮我在这里修理配件。Fit 命令也不起作用。
解决方案
检查以下内容:
代码:
### Limit fitted plot to data
reset session
$Data1 <<EOD
#veff S Pmax S Pmin
0.13 106 0.2177 152 -0.0729
0.14 105 0.2162 152 -0.0778
0.15 105 0.2127 152 -0.0819
0.16 105 0.2078 152 -0.0858
0.17 105 0.2018 153 -0.0879
0.18 104 0.1959 153 -0.0889
0.19 104 0.1907 153 -0.0898
0.20 103 0.1860 153 -0.0921
EOD
$Data2 <<EOD
#veff S Pmax S Pmin
0.10 103 0.2135 152 -0.0505
0.11 104 0.2162 152 -0.0592
0.12 105 0.2177 152 -0.0669
EOD
set xlabel "Pmax"
set ylabel "Pmin"
set title "Pmax vs Pmin"
unset key
FIT_LIMIT = 1e-6
f1(x) = a1*x**2 + b1*x + c1
f2(x) = a2*x**2 + b2*x + c2
fit [x=0.185:0.218] f1(x) $Data1 u 3:5 via a1,b1,c1
fit [x=0.212:0.218] f2(x) $Data2 u 3:5 via a2,b2,c2
plot $Data1 using 3:5 with p pt 7, \
[x=0.185:0.218] f1(x) lc rgb "red",\
$Data2 using 3:5 with p pt 8, \
[x=0.212:0.218] f2(x) lc rgb "green"
### end of code
结果:
推荐阅读
- mongodb - 总结猫鼬中所有子文档的价值
- google-cloud-platform - 简单的 GCP 云函数给出错误 ID:945b0f01
- c# - 如何让 OpenApi Generator 转换字典
正确吗? - sql - JPQL 选择公司、分公司、部门或部门层次结构的部分
- spring-boot - 休息模板 | 带有 SSL 的 HttpClient 无法设置连接池属性
- c++ - MIDI format1 -> MFC 中的 format0 转换器
- node.js - localtunnel 和 CORS 无法正常工作
- python - 如何读取excel电子表格并验证数据类型,并打印数据类型错误或为空的数据类型?
- ios - 不包括 testflight 中的 opencv2.framework
- python - 读取 csv 时将所有值转换为字符串