Main Content

极坐标区上的罗盘标签

以下示例演示如何在极坐标中绘制数据图。此外,还演示如何指定要绘制网格线的角度以及如何指定标签。

在极坐标中绘制数据图,并在每个数据点处显示一个圆形标记。

theta = linspace(0,2*pi,50);
rho = 1 + sin(4*theta).*cos(2*theta);
polarplot(theta,rho,'o')

Figure contains an axes object with type polaraxes. The polaraxes contains a line object which displays its values using only markers.

使用 gca 访问极坐标区对象。通过设置 ThetaTick 属性,指定绘制网格线的角度。然后,通过设置 ThetaTickLabel 属性,指定每条网格线的标签。

pax = gca;
angles = 0:45:360;
pax.ThetaTick = angles;
labels = {'E','NE','N','NW','W','SW','S','SE'};
pax.ThetaTickLabel = labels;

Figure contains an axes object with type polaraxes. The polaraxes contains a line object which displays its values using only markers.

另请参阅

| | | | |

相关主题