How to plot several curves on the same figure with a repeating x-axis

1 回表示 (過去 30 日間)
Gaétan Andriano
Gaétan Andriano 2020 年 11 月 12 日
コメント済み: Ameer Hamza 2020 年 11 月 12 日
I have a little problem. I would want to plot several curves on the same figure with a repeating x-axis but I don't know how. In attachment, you can see an example of a typical figure that I would like to obtain.
If you have any idea, I'm open.
Thank you

採用された回答

Ameer Hamza
Ameer Hamza 2020 年 11 月 12 日
Although not directly supported, you can modify the xticklabels to get something similar
x = linspace(0, 1);
y = x.^2;
figure()
axes();
hold on
plot(x, y);
plot(x+0.5, y);
plot(x+1.0, y);
plot(x+1.5, y);
xticklabels({'0', '0', '0', '0', '0.5', '1'})
  2 件のコメント
Gaétan Andriano
Gaétan Andriano 2020 年 11 月 12 日
Thank you a lot ! I didn't know that it was so simple !
Ameer Hamza
Ameer Hamza 2020 年 11 月 12 日
I am glad to be of help!!!

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

その他の回答 (0 件)

カテゴリ

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

製品

Community Treasure Hunt

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

Start Hunting!

Translated by