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 comentario

Star Strider
Star Strider el 19 de Mzo. de 2018
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).

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Creating, Deleting, and Querying Graphics Objects en Centro de ayuda y File Exchange.

Preguntada:

el 19 de Mzo. de 2018

Comentada:

el 19 de Mzo. de 2018

Community Treasure Hunt

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

Start Hunting!

Translated by