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

1 次查看(过去 30 天)
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 中查找有关 Lighting, Transparency, and Shading 的更多信息

产品


版本

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by