different colour combinations in matlab
1 次查看(过去 30 天)
显示 更早的评论
how to plot 20 different points in the plot in 20 different colours?
0 个评论
回答(2 个)
Chad Greene
2014-8-13
Use scatter. The syntax is scatter(x,y,Size,Colors). Size is the size of the markers and Colors can be 20 rgb values as in Example 1 here .
0 个评论
Amir
2014-8-13
Sindhu, use this code:
x=[1:20]./7;
y=sin(x);
hold on
for i=1:length(x)
plot(x(i),y(i),'*',...
'color', rand(1,3))
end
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Scatter Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!