Multiple plots in a single X and y axis
8 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Feniobu feniobu
il 26 Set 2020
Commentato: Star Strider
il 26 Set 2020
Hello, I want to write a program that can plot all variables in one graph sheet. A single input variable y-axis and at least 10 input variables on the z-axis.
0 Commenti
Risposta accettata
Star Strider
il 26 Set 2020
Example —
x = linspace(1, 2, 250);
y1 = sin(2*pi*x*5);
y2 = cos(2*pi*x*7);
figure
plot(x, y1)
hold on
plot(x, y2)
hold off
grid
legend('y2','y2')
.
4 Commenti
Star Strider
il 26 Set 2020
My pleasure!
I do not understand wanting to add a second x-axis when they are all plotted as functions of ‘t’. You can easily concatenate ‘h’ with the rest, and it will plot correctly, just as with the others. Adding it to the legend call is trivial. Scaling the y-axis to log makes them all easily visible.
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Line Plots in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!