Plot legend labels using loop
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Panos Kerezoudis
il 5 Apr 2023
Commentato: Panos Kerezoudis
il 8 Apr 2023
I am plotting the power spectrum from 16 channels. PSD was calculated using the pwelch function and its output has 3 dimensions: (Channels) x (Frequency index) x (Trial). Is there a way to produce the legend (data 1, data 2,...) with the channel numbers using a for loop, in order to avoid writing down all 16 labels?
thank you!
Here is what i get by the way:
figure(1), hold on
plot(f, mean(pwrsignal(:,:,:), 3), 'LineWidth', 2)
xlim([0 200])
legend
0 Commenti
Risposta accettata
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Legend 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!