How to change the color of plotting lines

956 visualizzazioni (ultimi 30 giorni)
ZC Song
ZC Song il 18 Giu 2019
Modificato: DGM il 18 Nov 2024 alle 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

Risposta accettata

Adam Danz
Adam Danz il 18 Giu 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 Commenti
ZC Song
ZC Song il 18 Giu 2019
Great it works!
Thank you very much!
Adam Danz
Adam Danz il 18 Giu 2019
Glad I could help!

Accedi per commentare.

Più risposte (1)

Asher
Asher il 17 Nov 2024 alle 21:18
Modificato: DGM il 18 Nov 2024 alle 5:32
You can try:
plot(x,y,'k')

Categorie

Scopri di più su 2-D and 3-D Plots in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by