Multi line color in graph

1 visualización (últimos 30 días)
Deepa Maheshvare
Deepa Maheshvare el 5 de Nov. de 2019
Comentada: Star Strider el 7 de Nov. de 2019
Hi,
While trying to plot a graph
plot(1:10, rand(10,10))
Each line has a different color.
Is it possible to vary the color scale from a darker shade to lighter shade? For instance, from black to grey

Respuesta aceptada

Star Strider
Star Strider el 5 de Nov. de 2019
Try this:
cmap = colormap(gray(10));
figure
hp = plot(1:10, rand(10));
set(gca,'ColorOrder',cmap)
Experiment to get dufferent results.
  12 comentarios
Deepa Maheshvare
Deepa Maheshvare el 7 de Nov. de 2019
Walter, I am uisng Windows OS. I upgraded from 2019a to 2019b. The solution that was posted earlier works fine now. Thank you
Star Strider
Star Strider el 7 de Nov. de 2019
@Deepa Maheshvare — Thank you for following up. I am happy that it worked for you.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Orange en Help Center y File Exchange.

Productos


Versión

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by