How to add legends in graphs generated within a for loop.

조회 수: 3 (최근 30일)
Ali Baig
Ali Baig 2017년 7월 19일
답변: Walter Roberson 2017년 7월 19일
I am writing a program in which graphs are generated within a for loop. How can I add legends for all the graphs.
for jj = 1 : 1 : NOE
ElementShape = dispVector( jj, 1) * shapeFunction1 + dispVector( jj+1, 1) * shapeFunction2;
range = ( jj - 1) * h : stepSize : jj * h;
totalShape = [totalShape, ElementShape];
totallength = [totallength, range];
plot(totallength, totalShape)
hold on
end

채택된 답변

Walter Roberson
Walter Roberson 2017년 7월 19일

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Legend에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by