Filter löschen
Filter löschen

How to change the color of a single point in a scatter plot?

24 Ansichten (letzte 30 Tage)
Irina
Irina am 26 Jul. 2013
Kommentiert: Jonatan Dias am 23 Sep. 2017
I am plotting points:
x = [ 1 1 1 1 1 2 2 2 2 2 3 3 3 3 3 4 4 4 4 4 5 5 5 5 5];
y = [ 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5];
plot(x,y,'*')
I would like to change the color of just an individual point, how do I go about it?

Akzeptierte Antwort

Azzi Abdelmalek
Azzi Abdelmalek am 26 Jul. 2013
x = [ 1 1 1 1 1 2 2 2 2 2 3 3 3 3 3 4 4 4 4 4 5 5 5 5 5];
y = [ 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5];
plot(x,y)
hold on
scatter(x(7),y(7),'r')
hold off
  3 Kommentare
Jonatan Dias
Jonatan Dias am 23 Sep. 2017
Thank you very much. God bless you.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by