How to plot several curves on the same figure with a repeating x-axis
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Gaétan Andriano
am 12 Nov. 2020
Kommentiert: Ameer Hamza
am 12 Nov. 2020
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
0 Kommentare
Akzeptierte Antwort
Ameer Hamza
am 12 Nov. 2020
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 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Subplots finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!