How to adjust the legend of a graph in this case?
조회 수: 1 (최근 30일)
이전 댓글 표시
Hi
In the below image each line has 3 segments which are represented with 3 colors. Lines are represented with *, - and + for 1st, 2nd and 3rd respectively. The problem is that in legend it is showing only one symbol with varying color which is not true in this case. In the legend, I want to show the corresponding symbol without color.
Please suggest me the code
figure
axes('FontSize', 20);
xlabel('1/T');ylabel('ln(g({\alpha})/T^{2}');title('@20^{0}C');
line_fewer_markers(T_3,O1_3,10,'-g*')
line_fewer_markers(T_6,O1_6,10,'-k*')
line_fewer_markers(T_8,O1_8,5,'-r*')
line_fewer_markers(T_3,O2_3,10,'-g-')
line_fewer_markers(T_6,O2_6,10,'-k-')
line_fewer_markers(T_8,O2_8,5,'-r-')
line_fewer_markers(T_3,O3_3,10,'-g+')
line_fewer_markers(T_6,O3_6,10,'-k+')
line_fewer_markers(T_8,O3_8,5,'-r+')
legend(' 1st ','2nd', '3rd')
.
Thanks
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/147692/image.png)
댓글 수: 0
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Legend에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!