Azzera filtri
Azzera filtri

Color individual data points

24 visualizzazioni (ultimi 30 giorni)
Claire Andreasen
Claire Andreasen il 16 Ago 2020
Commentato: Claire Andreasen il 17 Ago 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?

Risposta accettata

Image Analyst
Image Analyst il 16 Ago 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 Commento
Claire Andreasen
Claire Andreasen il 17 Ago 2020
Thank you!!! (I was missing the hold on and off hahah)

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Colormaps in Help Center e File Exchange

Prodotti


Release

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by