Borrar filtros
Borrar filtros

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

10 visualizaciones (últimos 30 días)
Irina
Irina el 26 de Jul. de 2013
Comentada: Jonatan Dias el 23 de Sept. de 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?

Respuesta aceptada

Azzi Abdelmalek
Azzi Abdelmalek el 26 de Jul. de 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 comentarios
Jonatan Dias
Jonatan Dias el 23 de Sept. de 2017
Thank you very much. God bless you.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

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

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by