필터 지우기
필터 지우기

different colour combinations in matlab

조회 수: 5 (최근 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 CenterFile Exchange에서 Scatter Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by