필터 지우기
필터 지우기

How I connect more legends?

조회 수: 1 (최근 30일)
Dominika
Dominika 2017년 3월 27일
답변: Thorsten 2017년 3월 28일
If I create a plot and then I connect 2 or more plots from different scripts. I want to have legends there about all plots. How I connect legends from more scripts? Thank you
  댓글 수: 1
Geoff Hayes
Geoff Hayes 2017년 3월 28일
Dominika - can you provide an example of when you create a plot and then connect 2 or more plots from different scripts. Do you mean that you just add two or more plots to the axes where you had "drawn" your initial plot? Please clarify.

댓글을 달려면 로그인하십시오.

답변 (1개)

Thorsten
Thorsten 2017년 3월 28일
You can use
h(1) = plot(... %your first plot
h(2) = plot(... % your second plot from another script
h(3) = plot(... % your third plot
% ... and so on
And then use
legend(h, {'first', 'second', 'third'}) % add more entries if you have more than three plots

카테고리

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