필터 지우기
필터 지우기

how to change color for one point in the scatter plot

조회 수: 9 (최근 30일)
TESFALEM ALDADA
TESFALEM ALDADA 2020년 11월 10일
편집: KSSV 2020년 11월 10일
I wanted to separatly color the markers in scatter plot.
e.g i ahve a date:
a=[1:10]'; b=[11:20]';
scatter(a,b,'o','filled');
here i wanted to change the color only for data in the row five (the circled one).
I appreaciate for you help

채택된 답변

Alan Stevens
Alan Stevens 2020년 11월 10일
a=[1:10]'; b=[11:20]';
scatter(a,b,'o','filled');
hold on
plot(a(5),b(5),'ro','MarkerFaceColor','r')

추가 답변 (1개)

KSSV
KSSV 2020년 11월 10일
편집: KSSV 2020년 11월 10일
a=[1:10]'; b=[11:20]';
scatter(a,b,'o','filled');
hold on
scatter(a(4),b(4),'or','filled')
Also you can use plot
a=[1:10]'; b=[11:20]';
plot(a,b,'.','MarkerSize',20);
hold on
plot(a(4),b(4),'.r','MarkerSize',20);

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by