Effacer les filtres
Effacer les filtres

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

24 vues (au cours des 30 derniers jours)
Irina
Irina le 26 Juil 2013
Commenté : Jonatan Dias le 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?

Réponse acceptée

Azzi Abdelmalek
Azzi Abdelmalek le 26 Juil 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 commentaires
bhavesh k.pacherwal
bhavesh k.pacherwal le 11 Juin 2017
thanks sir
Jonatan Dias
Jonatan Dias le 23 Sep 2017
Thank you very much. God bless you.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Scatter Plots dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by