MathTop

polar_plot 函数

绘制极坐标曲线 r(theta)。

语法

  • polar_plot(rExpr, t = a..b)
  • polar_plot(rExpr, t = a..b, option = value, ...)

参数与选项

expr要变换或求值的表达式。
range形如 x = a..b 的变量范围。
title图形上方显示的标题文本。
labels坐标轴或类别标签。2D 图通常为 [xLabel, yLabel];图表中在支持时用于标注分类。
legend单个数据系列的图例文本,或多个系列名称列表。
color / colour颜色名、CSS 颜色,或用于多个系列/图元的颜色列表。
style绘制风格:line 绘制连续线段,point 绘制采样点标记。
linestyle线型,例如 solid、dash、dot 或 dashdot。
thickness曲线、网格曲面和图元的线宽。
symbol点样式图中使用的点标记模式。
symbolsize采样点或显式点图元的标记半径。
axes坐标轴显示控制;使用 none/false 隐藏坐标轴。
gridlines网格线显示控制;true 显示,false 隐藏。
background图形背景颜色。
transparency透明度控制,范围 0 到 1,数值越大越透明。
view可见数值范围,例如 [xmin..xmax, ymin..ymax] 或 [xmin..xmax, ymin..ymax, zmin..zmax]。
numpoints / samples表达式绘图中使用的采样点数或网格采样数。

示例

  1. 极坐标曲线polar_plot(1 + cos(t), t = 0..2*pi)绘制一条心形线形式的极坐标曲线。
  2. 标题polar_plot(1 + cos(t), t = 0..2*pi, title = 'Cardioid')极坐标曲线带有指定标题。
  3. 坐标轴标签polar_plot(1 + cos(t), t = 0..2*pi, labels = ['x', 'y'])转换后的直角坐标轴使用给定标签。
  4. 图例polar_plot(1 + cos(t), t = 0..2*pi, legend = 'r = 1 + cos(t)')极坐标曲线带有说明性图例标签。
  5. 颜色polar_plot(1 + cos(t), t = 0..2*pi, color = purple)曲线绘制为紫色。
  6. 点样式polar_plot(1 + cos(t), t = 0..2*pi, style = point, symbolsize = 4, numpoints = 160)极坐标采样值以点显示。
  7. 线型polar_plot(1 + cos(t), t = 0..2*pi, linestyle = dot)曲线使用点线线型。
  8. 线宽polar_plot(1 + cos(t), t = 0..2*pi, thickness = 4)极坐标曲线使用更粗线宽。
  9. 坐标轴polar_plot(1 + cos(t), t = 0..2*pi, axes = none)隐藏极坐标图的坐标轴线。
  10. 网格线polar_plot(1 + cos(t), t = 0..2*pi, gridlines = false)隐藏网格线。
  11. 背景polar_plot(1 + cos(t), t = 0..2*pi, background = '#fff7ed')绘图使用指定的暖色背景。
  12. 透明度polar_plot(1 + cos(t), t = 0..2*pi, transparency = 0.25)曲线以部分透明效果显示。
  13. 显示范围polar_plot(1 + cos(t), t = 0..2*pi, view = [-2..2, -2..2])将可见窗口固定在极坐标曲线周围。
  14. 综合选项polar_plot(1 + cos(t), t = 0..2*pi, title = 'Polar', legend = 'cardioid', color = red, linestyle = dashdot, thickness = 3, view = [-2..2, -2..2], samples = 240)同时应用多项样式、范围和采样选项。