different colour combinations in matlab

1 回表示 (過去 30 日間)
sindhu
sindhu 2014 年 8 月 13 日
回答済み: Amir 2014 年 8 月 13 日
how to plot 20 different points in the plot in 20 different colours?

回答 (2 件)

Chad Greene
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 .

Amir
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

カテゴリ

Help Center および File ExchangeScatter Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by