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 件のコメント

Star Strider
Star Strider 2018 年 3 月 19 日
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 ExchangeCreating, 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