2016-09-21 5 views
0

私はより多くの色を得るために極座標プロットのカラーマップを変更しようとしています。デフォルトのmatlabカラーマップには十分な色がないので、それが繰り返され、これは視聴者にとって混乱を招きます。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 

私はこれを実行したときしかし、私はまだ同じ7つのデフォルトのカラーマップの色を取得します。どのように特定のカラーマップを使用するように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

関連する問題