필터 지우기
필터 지우기

plot of markers, having different color in one line of code.

조회 수: 1 (최근 30일)
mikkel stær
mikkel stær 2021년 3월 14일
답변: ANKUR KUMAR 2021년 3월 15일
hi why can i not do the following. when it follows the rules from the "plot" command sytax
i want one line and write plot one time, with all the information inside.
since i already know that i could just write them seperately.
plot(x2,y2,".",'MarkerFaceColor',[0.500 0.3250 0.0500], "Markersize",20,x3,y3,".",'MarkerFaceColor',[0.8500 0.3250 0.0980], "Markersize",20)
or
plot(x2,y2,".",'MarkerFaceColor',[0.500 0.3250 0.0500],x3,y3,".",'MarkerFaceColor',[0.8500 0.3250 0.0980], "Markersize",20)
is there a way to nest with () or [] or {} pls help.

채택된 답변

ANKUR KUMAR
ANKUR KUMAR 2021년 3월 15일
x2=[1,3];
y2=[3,4];
x3=[3,4,5];
y3=[1,6,7];
cell_values={x2,y2;x3,y3};
col_vals={[0.500 0.3250 0.0500],[0.8500 0.3250 0.0980]};
for kk=1:size(cell_values,1)
plot(cell_values{kk,1},cell_values{kk,2},'kd','MarkerFaceColor',col_vals{kk})
hold on
end

추가 답변 (0개)

카테고리

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

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by