Linestyle does not change

22 vues (au cours des 30 derniers jours)
ALZ
ALZ le 1 Août 2016
Modifié(e) : ALZ le 2 Août 2016
Hi, am having a trboule with plot and linestyle commands.
Am using the following code
plot(t,r2,'--b');hold on
plot(t,r3,'-.r'); hold on
plot(t,r1,':g'); hold off
But still am having the same linestyle on all curves (--)?
I have tried several ways to go around this problem, but with no luck at all
Thanks
  5 commentaires
Image Analyst
Image Analyst le 2 Août 2016
Are you sure your r are all 1-D vectors and not 2-D matrices?
ALZ
ALZ le 2 Août 2016
Well, in fact Rs as well as Ts are all one column vector of different lengths

Connectez-vous pour commenter.

Réponses (3)

Azzi Abdelmalek
Azzi Abdelmalek le 1 Août 2016
Increase the line width
t=0:0.1:10
r1=sin(t)
r2=2*cos(t)
r3=t
plot(t,r2,'--b');hold on
plot(t,r3,'-.r','linewidth',3); hold on
plot(t,r1,':g','linewidth',3);

ALZ
ALZ le 2 Août 2016
It seems the linewidth command partially solves the problem, Thank you Azzi, but increasing the linewidth is not an option, this way am going to miss some information.

ALZ
ALZ le 2 Août 2016
Modifié(e) : ALZ le 2 Août 2016
Thanks for everyone, it is a rendering problem, if anyone is interested, the problem should be solved by setting the renderer;
figure(1)
plot(t,r2,'--b');hold on
plot(t,r3,'-.r'); hold on
plot(t,r1,':g');
set(figure(1),'Renderer','painters')

Catégories

En savoir plus sur Line Plots dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by