Can I set MarkerFaceColor to part of the data points?

2 visualizaciones (últimos 30 días)
Xingwang Yong
Xingwang Yong el 8 de Dic. de 2020
Comentada: Walter Roberson el 8 de Dic. de 2020
plot(1:10,1:10,'s')
Can I set MarkerFaceColor to red for point 1,2,3 while leave the other points unchanged?
I tried in interactive figure editor, it seems this is impossible.

Respuesta aceptada

Star Strider
Star Strider el 8 de Dic. de 2020
Yes!
figure
plot(1:10, 1:10, 's')
hold on
plot((1:3), (1:3), 'sr','MarkerFaceColor','r')
hold off
.
  9 comentarios
Star Strider
Star Strider el 8 de Dic. de 2020
As always, my (our) pleasure!
Walter Roberson
Walter Roberson el 8 de Dic. de 2020
Ah, on desktop changing the MarkerHandle.FaceColorData to a 4 x N uint8 array gives a warning about wrong data. If you change it to a 4 x 1 uint8 array, then it does affect what is drawn.
MATLAB Online did not give me the warning message, but ignored the 4 x N data anyhow.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Graphics Performance en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by