Problem when define Line Style and Linewidth

I am using the below code to plot 3 lines and when I define the Line Style and Linewidth, the text in the legend disappears. I tried rescaling the figure by using 'Position' and make it bigger but this didn'r solve the problem. Do you know how can I fix this? I am using the 2017b version.
t = linspace(0,5,100);
x = t.^2;
y = t.^3;
z = t.^4;
figure;
plot(t,x,'Linewidth',1)
hold on
plot(t,y,'--','Linewidth',1)
plot(t,z,':','Linewidth',1)
legend({'x','y','z'},'Location','Northwest')

댓글 수: 1

With the code you posted, I cannot reproduce the problem you describe. Your code runs correctly for me, and the legend box, text, and correct line types and color designations appear (in R2017b).

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

답변 (0개)

카테고리

도움말 센터File Exchange에서 Creating, Deleting, and Querying Graphics Objects에 대해 자세히 알아보기

질문:

2018년 3월 19일

댓글:

2018년 3월 19일

Community Treasure Hunt

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

Start Hunting!

Translated by