Main Content

本页翻译不是最新的。点击此处可查看最新英文版本。

polar

(不推荐)极坐标图

不推荐使用 polar。请改用 polarplot。有关更新代码的信息,请参阅版本历史记录

说明

polar(theta,rho) 在极坐标中绘制线条,由 theta 表示弧度角,rho 表示每个点的半径值。thetarho 必须大小相同。

示例

polar(theta,rho,LineSpec) 指定极坐标图中所绘制线条的线型、标记符号和颜色。

polar(ax,___) 在指定坐标区而不是当前坐标区 (gca) 中绘图。

ln = polar(___) 返回用于创建极坐标图的 Line 对象。创建极坐标图后,使用 ln 修改极坐标图。有关属性列表,请参阅 Line 属性

示例

全部折叠

使用红色虚线创建一个极坐标图。

theta = 0:0.01:2*pi;
rho = sin(2*theta).*cos(2*theta);
polar(theta,rho,"--r")

输入参数

全部折叠

角度值,指定为向量或矩阵。指定弧度值。

半径值,指定为向量或矩阵。

rho 值通过原点形成中心对称反射,旋转 pi 角度(因为 (theta,rho) 可转换为 (rho*cos(theta),rho*sin(theta)))。如果希望获得不同的行为,可以在绘图前操作 rho。例如,您可以将 rho 设置为等于 max(0,rho)abs(rho)

线型、标记和颜色,指定为包含符号的字符串标量或字符向量。符号可以按任意顺序显示。您不需要同时指定所有三个特征(线型、标记和颜色)。例如,如果忽略线型,只指定标记,则绘图只显示标记,不显示线条。

示例: "--or" 是带有圆形标记的红色虚线。

线型描述表示的线条
"-"实线

Sample of solid line

"--"虚线

Sample of dashed line

":"点线

Sample of dotted line

"-."点划线

Sample of dash-dotted line, with alternating dashes and dots

标记描述生成的标记
"o"圆圈

Sample of circle marker

"+"加号

Sample of plus sign marker

"*"星号

Sample of asterisk marker

"."

Sample of point marker

"x"叉号

Sample of cross marker

"_"水平线条

Sample of horizontal line marker

"|"垂直线条

Sample of vertical line marker

"square"方形

Sample of square marker

"diamond"菱形

Sample of diamond marker

"^"上三角

Sample of upward-pointing triangle marker

"v"下三角

Sample of downward-pointing triangle marker

">"右三角

Sample of right-pointing triangle marker

"<"左三角

Sample of left-pointing triangle marker

"pentagram"五角形

Sample of pentagram marker

"hexagram"六角形

Sample of hexagram marker

颜色名称短名称RGB 三元组外观
"red""r"[1 0 0]

Sample of the color red

"green""g"[0 1 0]

Sample of the color green

"blue""b"[0 0 1]

Sample of the color blue

"cyan" "c"[0 1 1]

Sample of the color cyan

"magenta""m"[1 0 1]

Sample of the color magenta

"yellow""y"[1 1 0]

Sample of the color yellow

"black""k"[0 0 0]

Sample of the color black

"white""w"[1 1 1]

Sample of the color white

目标坐标区,指定为 Axes 对象。如果未指定坐标区,则 MATLAB® 将在当前坐标区中进行绘制;或如果不存在 Axes 对象,则创建一个对象。polar 不支持在 PolarAxes 对象中绘图。

扩展功能

版本历史记录

在 R2006a 之前推出

全部展开

另请参阅

| |