Effacer les filtres
Effacer les filtres

different colour combinations in matlab

5 vues (au cours des 30 derniers jours)
sindhu
sindhu le 13 Août 2014
Réponse apportée : Amir le 13 Août 2014
how to plot 20 different points in the plot in 20 different colours?

Réponses (2)

Chad Greene
Chad Greene le 13 Août 2014
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 le 13 Août 2014
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

Catégories

En savoir plus sur Scatter Plots dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by