【问题标题】:smoothing graph line in MatlabMatlab中的平滑图形线
【发布时间】:2023-03-22 14:42:01
【问题描述】:

我有以下图表,我想通过平滑图表使其更悦目。有可能吗?

tempyr = 1880:1:2014;  
temperature = temp(1:2, 1:135);
Tempval = {'Annual Mean','5 Year Mean'}
TH = zeros(size(Tempval));
hold on
TH = plot( tempyr', temperature', '-o', 'Marker', '.');
xlabel( 'year', 'fontsize', 24); ylabel( 'Temperature Anomaly (Degree Cel)', 'fontsize', 24 );
legend(TH, Tempval)
grid on

理想的图表。

【问题讨论】:

  • 您要平滑哪个图形?年均值? 5年是什么意思?您能否举例说明您如何设想这种平滑的结果?您将如何解决数据丢失问题?
  • 理想图与您制作的图有何不同?
  • 您是否希望线路没有楼梯?喜欢抗锯齿?
  • @Mathias 是的。我想消除高度的急剧下降或增加。 (楼梯)这可能吗?另外我如何将这样的功能合并到我的代码中?
  • 如果你有曲线拟合工具箱,可以使用smooth()函数。

标签: matlab graph smoothing loess


【解决方案1】:

试试

TH = plot( tempyr', temperature', '-o', 'Marker', '.','LineSmoothing','on');

还可以查看here,尤其是export_fig 参考可能会很有用。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-02-07
    • 2021-11-28
    • 1970-01-01
    • 2011-09-11
    • 1970-01-01
    • 2023-03-08
    • 2017-12-02
    相关资源
    最近更新 更多