Multiple Lines in a Stacked Plot
16 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Felipe Dicker
il 21 Nov 2023
Commentato: Dyuman Joshi
il 21 Nov 2023
I'd like to have 3 different vectors plotted onto 2 graphs within a stacked plot. For example, I wish to plot vectors a and b in the first graph of the stacked plot and variable c on the second graph, with the x-axis of the stacked plot being another vector, t. How would I be able to do that?
0 Commenti
Risposta accettata
Dyuman Joshi
il 21 Nov 2023
Spostato: Dyuman Joshi
il 21 Nov 2023
If you are working with R2018b or a later version, check out stackedplot
%Random data
n = 10;
t = (1:n).';
a = zeros(n,1);
b = ones(n,1);
c = rand(n,1);
data = table(t, a, b, c)
vars = {["a" "b"], "c"};
stackedplot(data, vars, "XVariable", "t")
4 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Annotations in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!