フィルターのクリア

Shade standard deviation for time series

15 ビュー (過去 30 日間)
JAIME DIEGO RICO
JAIME DIEGO RICO 2020 年 7 月 10 日
コメント済み: Star Strider 2020 年 7 月 18 日
Hi!
I'm trying to shade the std (daily_std) for mean sst (daily_average).
I've seen similar questions, but those codes don't work for me.
My x-axis is one year of date times. My y axis is the mean of sst.
I've done the following code:
figure
curve1=daily_average(:,1)+daily_std(:,1); %only column 1 because every column is one different location
curve2=daily_average(:,1)-daily_std(:,1);
plot(date,curve1,'r')
hold on
plot(date,curve2,'r')
hold on
date2 = [date, fliplr(date)];
inBetween = [curve1, fliplr(curve2)];
fill(date2, inBetween, 'g');
hold on;
plot(date, daily_average(:,1));
However, I obtain the following result:
Any idea?
Thank you very much

採用された回答

Star Strider
Star Strider 2020 年 7 月 10 日
I cannot run your code, so I cannot test this.
However, fill may not be appropriate here. See if using patch instead does shat you want:
patch(date2, inBetween, 'g');
Your curtrent syntax will work for patch, so no other changes are necessary.
  5 件のコメント
JAIME DIEGO RICO
JAIME DIEGO RICO 2020 年 7 月 18 日
Thank you very much!!!! It worked!
Star Strider
Star Strider 2020 年 7 月 18 日
As always, my pleasure!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeScatter Plots についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by