Filter löschen
Filter löschen

Color individual data points

24 Ansichten (letzte 30 Tage)
Claire Andreasen
Claire Andreasen am 16 Aug. 2020
Kommentiert: Claire Andreasen am 17 Aug. 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?

Akzeptierte Antwort

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

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Colormaps finden Sie in Help Center und File Exchange

Produkte


Version

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by