How to change the color of plotting lines

943 vues (au cours des 30 derniers jours)
ZC Song
ZC Song le 18 Juin 2019
Modifié(e) : DGM le 18 Nov 2024 à 5:32
Hi,
I have multiple lines to plot but by defualt they are different color, how to change the color to uniform color?
I tried to do this but failed (see below)
QQ截图20190618140313.png
QQ截图20190618140358.png

Réponse acceptée

Adam Danz
Adam Danz le 18 Juin 2019
The line of code that apparently does the plotting is cut off in your image.
Either specify the color during plotting
plot(x,y,'color', 'b');
or set the color later using the output handles
h = plot(x,y);
set(h, 'Color', 'b')
  2 commentaires
ZC Song
ZC Song le 18 Juin 2019
Great it works!
Thank you very much!
Adam Danz
Adam Danz le 18 Juin 2019
Glad I could help!

Connectez-vous pour commenter.

Plus de réponses (1)

Asher
Asher le 17 Nov 2024 à 21:18
Modifié(e) : DGM le 18 Nov 2024 à 5:32
You can try:
plot(x,y,'k')

Catégories

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

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by