graph - 如何在 IDL 中对图表上的数据点进行曲线拟合?
问题描述
我正在寻找使用 IDL 曲线拟合图表上的一些数据点。我目前有以下图表
我能够使用命令 robust_linefit 在图 3 上获得一条最佳拟合线,但我无法使用命令 curvefit 在需要曲线拟合而不是直线的图形上绘制曲线。
当我尝试曲线拟合时,我无法定义命令所需的函数,因为它只是随机数据,我无法为整个数据计算函数。
与我一起工作的教授告诉我有关平滑命令的信息,但我无法在 harrisgeospatial 网站上找到任何与绘图特别相关的命令。有一些选项可以取数据的平均值,但我不知道如何使用这些命令来拟合我的图表。
如果不是太麻烦,有人可以解释如何绘制曲线拟合。
编辑:
我忘了像现在一样发布包含绘图命令的代码。
!p.multi = [0,2,4]
Window, 0, xsize = 1250, ysize = 1250
plot, x, y, ytitle='Temperature (C)', xtitle = 'time', $
title='Temperature variation on May 31st, 2021', xrange = [0, 24], psym=1
plot, x, z, ytitle = 'Humidity (%)', xtitle = 'time', $
title = 'Humidity variation over 24 hours on May 31st, 2021', xrange = [0,24], psym =1
plot, x, b, ytitle = 'Wind direction', xtitle = 'time', $
title = 'Wind direction and pressure over 24 hours on May 31st, 2021', xrange = [0,24], psym = 1
;linefit the graph
coeff = robust_linefit(x,b, sfit)
oplot, x, sfit, color = 1
plot, x, c, ytitle = 'Solar irradiance (W/m^2)', xtitle = 'time', $
title = 'Solar irradiance variation over 24 hours on May 31st, 2021', xrange = [0,24], psym = 1
plot, x, d, ytitle = 'Wind Speed (m/s)', xtitle = 'Time',$
title = 'Wind Speeds over 24 hours on May 31st, 2021', xrange = [0,24], psym = 1
plot, x, e, ytitle = 'Battery Voltage (V)', xtitle = 'Time', $
title = 'Battery Voltage variation over 24 hours on May 31st, 2021', xrange = [0,24], yrange = [13.2,14], psym = 1
plot, x, a, ytitle = 'Pressure (kPa)', xtitle = 'Time', $
title = 'Atmospheric Pressure variation over 24 hours on May 31st, 2021', xrange = [0, 24], yrange = [102,102.75], psym = 1
解决方案
推荐阅读
- wordpress - 如何创建一个按钮来镜像视频
- c# - 在 C# 中从数据库中编写文章及其评论(仅在控制台中测试)
- c++ - C++:错误:链接器命令失败,退出代码为 1(使用 -v 查看调用)
- c++ - 尝试在 OpenGL 3 中进行鼠标拾取时获取不正确的向量
- java - 使用 jpa 标准 api 进行复杂过滤
- python - Selenium 没有针对 XPATH Python 选择值
- python - URLS 循环以获取财务数据
- javascript - 从单独的回调中获取 Promise 解决方案
- c# - 如何在 Quartz.NET 作业中注入 NavigationManager?
- c# - 如何在 wix 中实现安装程序进度条的回滚?