请教matlab大神,为什么图例中线条颜色和画出来的曲线对不上呢??颜色种类和顺序都对不上,求教!

2025-03-12 22:27:35
推荐回答(1个)
回答1:

你这里polar函数可以改用polarplot函数,然后去掉set(polar(theta,y1),'LineWidth', 2)和view(90, -90)。

polarplot函数基本使用格式(适用于R2006a以上版本)

polarplot(theta,rho,LineSpec) 设置线条的线型、标记符号和颜色。

所以对于你的问题,可以这样来改

polarplot(theta,y1,'-r','LineWidth', 2),hold on

polarplot(theta,y2,'-g','LineWidth', 2),hold on

polarplot(theta,y3,'-b','LineWidth', 2)

运行后的效果