Notice
Recent Posts
Recent Comments
Link
«   2025/04   »
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30
Tags
more
Archives
Today
Total
관리 메뉴

자료 매번 검색하기 귀찮아서 만든 블로그

MATLAB - 일부 그림에만 범례 붙이기 본문

Matlab

MATLAB - 일부 그림에만 범례 붙이기

쿠키아버님 2021. 12. 17. 17:46

그림은 그리되, 범례를 넣고싶지 않은 그림이 있을 때 사용

plot(...., 'HandleVisibility', 'off')

 

예시

 

 

a, b, c = rand(10, 1), rand(10, 1), rand(10, 1);
t=1:10;

plot(t,a)
hold on
plot(t, b)
plot(t, c)
yline(0.5)
legend('Fontsize',25)

 

 

만약 여기서 yline(0.5) (data4)의 범례를 제거하고 싶으면,

plot(t,a)
hold on
plot(t, b)
plot(t, c)
yline(0.5, 'HandleVisibility','off')
legend('Fontsize',25)