same display name in two different plot
조회 수: 2 (최근 30일)
이전 댓글 표시
How can i use the same display name in two different plot ? and have one display name on the legend.
답변 (1개)
Luca Ferro
2023년 5월 8일
이동: Image Analyst
2023년 5월 8일
plot(ax, [X1 X2],[Y1 Y2], 'LineWidth',t,'Color',b, 'Displayname', 'Line');
hold on
%... rest of the code
plot(ax, [X1_2 X2_2 ],[Y1_2 Y2_2], 'LineWidth',t_2,'Color','g', 'Displayname', 'Line);
hold off
댓글 수: 2
Luca Ferro
2023년 5월 8일
편집: Luca Ferro
2023년 5월 8일
after the two plot(...) use this:
legend('signalName','signalName')
i think this is the closest we can be. Having two lines of different color with only one entry in the legend that describes them both is not supported(as far as i know) and also is not how a legend should work .
If you really want only one entry for both make them of the same color and use again the legend command with only one entry.
참고 항목
카테고리
Help Center 및 File Exchange에서 Legend에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!