How to change the order of graphs using errorbar

2 ビュー (過去 30 日間)
Chang seok Ma
Chang seok Ma 2021 年 9 月 3 日
コメント済み: Chang seok Ma 2021 年 9 月 3 日
Hello,
I am trying to plot some graphs using errorbar.
Here is the part of the code and the result
quant = 1.68;
linewidth = 0.5;
alp = 0.2;
cutoff = 0.06; %0.1
coefficients1 = xlsread('data1.xlsx',specification,'C4:K4');
ses1 = xlsread('data1.xlsx',specification,'C5:K5');
coefficients2 = xlsread('data2.xlsx',specification,'C4:K4');
ses2 = xlsread('data2.xlsx',specification,'C5:K5');
coefficients3 = xlsread('data3.xlsx',specification,'C4:K4');
ses3 = xlsread('data3.xlsx',specification,'C5:K5');
horizon1 = xlsread('data1.xlsx',specification,'C2:K2');
horizon2 = horizon1 - 0.2*ones(1,length(horizon1));
horizon3 = horizon1 + 0.2*ones(1,length(horizon1));
errorbar(horizon1(h_to_plot),coefficients1(h_to_plot),quant*ses1(h_to_plot),'o','Linewidth',1.5)
hold on
errorbar(horizon2(h_to_plot),coefficients2(h_to_plot),quant*ses2(h_to_plot),'o','Linewidth',1.5)
hold on
errorbar(horizon3(h_to_plot),coefficients3(h_to_plot),quant*ses3(h_to_plot),'o','Linewidth',1.5)
line([-4,7],[0,0],'Color',black,'LineStyle','-')
hold off
legend('Baseline','1 lag, 1 lead','2 lags, 2 leads','location','southwest')
I wanted to put coefficients1 first and then 2 and 3.
But when I plot the graphs it starts with coefficients2 then 1 and 3.
How can I change this?
Thank you.

採用された回答

Walter Roberson
Walter Roberson 2021 年 9 月 3 日
編集済み: Walter Roberson 2021 年 9 月 3 日
pos1 = xlsread('data1.xlsx',specification,'C2:K2');
horizon1 = pos1 - 0.2*ones(1,length(pos1));
horizon2 = pos1;
horizon3 = pos1 + 0.2*ones(1,length(pos1));
  1 件のコメント
Chang seok Ma
Chang seok Ma 2021 年 9 月 3 日
Thank you very much!

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

その他の回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by