필터 지우기
필터 지우기

Scatter Plot and Conditional Colour Gradients.

조회 수: 15 (최근 30일)
Zaharaddeen Hussaini
Zaharaddeen Hussaini 2017년 12월 31일
답변: Walter Roberson 2017년 12월 31일
f_tot = rand(50,9);
hold on
box on
for ph = 1:length(numhels)
for pr = 1: 1:Nrows(1)
if f_tot(ph,pr) >= 0.85000
c = 'red';
scatter(x(ph,pr),y(ph,pr),9,c,'filled');
hold on;
else
if f_tot(ph,pr) >= 0.7 && f_tot(ph,pr) <= 0.84999
c = 'yellow';
scatter(x(ph,pr),y(ph,pr),9,c,'filled');
hold on;
else
if f_tot(ph,pr) >= 0.6 && f_tot(ph,pr) <= 0.69999
c = 'green';
scatter(x(ph,pr),y(ph,pr),9,c,'filled');
hold on;
else
if f_tot(ph,pr) >= 0.4 && f_tot(ph,pr) <= 0.59999
c = 'cyan';
scatter(x(ph,pr),y(ph,pr),9,c,'filled');
hold on;
else
if f_tot(ph,pr) < 0.40
c = 'blue';
scatter(x(ph,pr),y(ph,pr),9,c,'filled');
hold on;
end
end
end
end
end
end
end
Hello,
Can the scatter plot be made to take in the colormap or jet function.Instead of the 'c'defining specific colors but rather have the entire points in the plot as a gradient.
Thanks

채택된 답변

Walter Roberson
Walter Roberson 2017년 12월 31일
No loops:
scatter(x(:), y(:), 9, f_tot(:), 'filled');
colormap(jet)

추가 답변 (0개)

카테고리

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