在 Matlab 中更改极坐标图的颜色图?

Changing colormap for a polarplot in Matlab?

我正在尝试更改极坐标图的颜色图以获得更多颜色。默认的 matlab 颜色图没有足够的颜色,所以它会重复,这会让观众感到困惑。

我写了一个我正在尝试做的简化示例:

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 使用特定的颜色图?

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