How to shift one of the plots in a figure to the right.

2 ビュー (過去 30 日間)
Sara
Sara 2019 年 2 月 5 日
コメント済み: Sara 2019 年 2 月 5 日
Hello,
I have two dataset (the second one is subset of the first data set, predicting with NN). I want to plot both of them and shift the second one to the right in order to compare the real value and predicted value (something like the attached plot). I also attached my plot in second file. I want to know how to shift blue plot to right.
Thanks in advance,

採用された回答

KSSV
KSSV 2019 年 2 月 5 日
You may try like below:
t = linspace(0,2*pi,500) ;
y1 = sin(t) ;
y2 = rand*sin(t(end-24:end)) ;
plot(t,y1)
hold on
plot(t(end-length(y2)+1:end),y2)
  1 件のコメント
Sara
Sara 2019 年 2 月 5 日
It solves my problem. Thanks

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

その他の回答 (0 件)

カテゴリ

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

タグ

製品


リリース

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by