Can I set MarkerFaceColor to part of the data points?

조회 수: 4 (최근 30일)
Xingwang Yong
Xingwang Yong 2020년 12월 8일
댓글: Walter Roberson 2020년 12월 8일
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.

채택된 답변

Star Strider
Star Strider 2020년 12월 8일
Yes!
figure
plot(1:10, 1:10, 's')
hold on
plot((1:3), (1:3), 'sr','MarkerFaceColor','r')
hold off
.
  댓글 수: 9
Star Strider
Star Strider 2020년 12월 8일
As always, my (our) pleasure!
Walter Roberson
Walter Roberson 2020년 12월 8일
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.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Annotations에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by