Editing Legend/Plotting

조회 수: 3 (최근 30일)
WARRIOR24
WARRIOR24 2021년 5월 5일
댓글: KSSV 2021년 5월 5일
I have this plot that shows the same colors and I would like add points, N=1 would be boxes, N=9 would be triangles, N=20 would be circles. As well as change each of their colors and thickness. Data is showing up in legend and I would want to take that out.
Mat_w = -.5:.5:.5;
u = s\f;
title('Case 2')
legend('N=5','N=9', 'N=20');
hold on
plot(Mat_w, u, 'g-')
xlim([-w,w])

답변 (1개)

KSSV
KSSV 2021년 5월 5일
Try:
Mat_w = -.5:.5:.5;
u = s\f;
title('Case 2')
hold on
plot(Mat_w, u)
xlim([-w,w])
legend('N=5','N=9', 'N=20');
  댓글 수: 2
WARRIOR24
WARRIOR24 2021년 5월 5일
That cleared up the data part in the legend, how do I change each color and make them plot different line styles?
KSSV
KSSV 2021년 5월 5일
What is s and f? It is not defined/ given in the code.

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

카테고리

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

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by