Filter löschen
Filter löschen

Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

Add a legend in plotting

1 Ansicht (letzte 30 Tage)
Skydriver
Skydriver am 6 Dez. 2017
Geschlossen: Walter Roberson am 6 Dez. 2017
I want to add a legend in my plotting, in the explanation I want to add some kind of text 500 years, 1000 years, 2500 years and 5000 years.
My code is:
for i=1:length(Tm2) plot(Tm1(:,1),(SA10(:,1)),'r'); hold on plot(Tm1(:,1),(SA5(:,1)),'b'); hold on plot(Tm1(:,1),(SA2(:,1)),'g'); hold on plot(Tm1(:,1),(SA1(:,1)),'m'); hold on title UniformHazardSpectra50Year xlabel('time'); ylabel('Acceleration'); legend(500,1000,2500,5000); end
Is there anybody can help me, why it doesn't works. The result is weird.
  1 Kommentar
Walter Roberson
Walter Roberson am 6 Dez. 2017
Duplicates https://www.mathworks.com/matlabcentral/answers/371392-add-a-legend-in-plotting

Antworten (0)

Diese Frage ist geschlossen.

Community Treasure Hunt

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

Start Hunting!

Translated by