2016-09-21 2 views
0

더 많은 색상을 얻기 위해 극좌표의 색상 맵을 변경하려고합니다. 기본 matlab 색상 맵에는 충분한 색상이 없으므로 반복되므로 뷰어에게 혼란을줍니다. 나는이 프로그램을 실행할 때 나는 여전히 같은 7 개 기본 컬러 맵의 색상을 얻을 그러나Matlab에서 polarplot에 대한 색상 맵 변경 중?

theta = linspace(0,6*pi); 
rho1 = theta/10; 
polarplot(theta,rho1) 
hold on 
for n = 1:15 
    rho2 = theta/(12-n/5); 
    polarplot(theta,rho2) 
end 
fig = gcf; 
colormap(fig, hsv(16)) 
hold off 

:

은 내가 할 노력하고있어의 간단한 예를 썼다. 어떻게 특정 색상 맵을 사용하도록 matlab에 강요합니까? enter image description here

답변

1
theta = linspace(0,6*pi); 
rho1 = theta/10; 
c = colormap(hsv(16)); 
polarplot(theta,rho1,'color',c(1,:)) 
hold on 
for n = 1:15 
    rho2 = theta/(12-n/5); 
    polarplot(theta,rho2,'color',c(n+1,:)) 
end 
+0

정말 고마워요! – ErinGoBragh