Effacer les filtres
Effacer les filtres

How I will change the line widith for to function in the same plot comand

1 vue (au cours des 30 derniers jours)
F.O
F.O le 9 Déc 2017
Réponse apportée : Matt J le 9 Déc 2017
Hello, How I will change the line width for two functions in the same plot command? or I will need to do it in a separate command?
figure(2
x=[0:0.1:1];
y=tan(x);
z=sin(x);
plot(x,y,'g-.',x,z,'r*--')
hleg1 = legend('tan(x)','sin(x)'); grid on;
xlabel('x')
ylabel('y')

Réponse acceptée

Matt J
Matt J le 9 Déc 2017
You can do, for example
plot(x,y,'g-.', x,z,'r*--','LineWidth', 3)
If you want different line widths for each curve, you would need additional statements
h=plot(x,y,'g-.',x,z,'r*--');
h(1).LineWidth=3;
h(2).LineWidth=4;

Plus de réponses (0)

Catégories

En savoir plus sur 2-D and 3-D Plots dans Help Center et File Exchange

Tags

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by