Borrar filtros
Borrar filtros

Color individual data points

24 visualizaciones (últimos 30 días)
Claire Andreasen
Claire Andreasen el 16 de Ag. de 2020
Comentada: Claire Andreasen el 17 de Ag. de 2020
I have this plot
plot(strain,Ystress,'LineWidth',2, "MarkerSize",5, "MarkerFaceColor",[0 0.4470 0.7410], "MarkerEdgeColor",[0 0.4470 0.7410] );
it plots all my data points (29 of them) blue
There is one data point (say strain(4), Ysress(4)) I want to be red and another data point (say strain(10), Ysress(10)) I want to be green how would I do this?

Respuesta aceptada

Image Analyst
Image Analyst el 16 de Ag. de 2020
One way is to just stamp a new marker right on top of the existing one:
plot(strain,Ystress,'LineWidth',2, "MarkerSize",5, "MarkerFaceColor",[0 0.4470 0.7410], "MarkerEdgeColor",[0 0.4470 0.7410] );
hold on;
plot(strain(4),Ystress(4), 'r.', "MarkerSize", 25); % Big red dot.
plot(strain(10),Ystress(10), 'g.', "MarkerSize", 25); % Big green dot.
hold off;
  1 comentario
Claire Andreasen
Claire Andreasen el 17 de Ag. de 2020
Thank you!!! (I was missing the hold on and off hahah)

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

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

Etiquetas

Productos


Versión

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by