Skip to content

PolarPlot

Magnitude and angle data sets on polar axes (SPEC-002).

PolarPlot, light theme PolarPlot, dark theme

Graphs, specialized · Widget catalog · API reference · schema polar.schema.json

Example

The traits of the picture above:

theta = np.arange(0, 361, 5)
r = np.abs(np.cos(np.radians(theta))) ** 3
ai.PolarPlot(
    value=[{"name": "pattern", "r": r.tolist(), "theta": theta.tolist()}],
    label="PolarPlot",
    size=(220, 220),
)

Traits

Trait Type Default Set by Description
value array of object [] host Data sets {name, color, style, r, theta}; r and theta have the same length.
angle_unit "deg", "rad" "deg" host
zero "E", "N" "E" host Where angle 0 is: east (mathematical) or north (compass).
direction "ccw", "cw" "ccw" host Positive sense of the angles.
r_max number or null null host, widget Radial range; null or not positive: scaled to the data. Set by the operator with the mouse wheel or the r max field (CHART-108).
rings integer 4 host Approximate number of grid rings.
unit string "" host
Common traits (10), shared with other widgets
Trait Type Default Set by Description
mode "control", "indicator" "indicator" host "control": the user sets the value; "indicator": display only.
label string "" host Plain text, never interpreted as HTML (SEC-002).
disabled boolean false host Greyed out, input rejected.
visible boolean true host
tooltip string "" host Plain text shown on hover.
size array [260,260] host [width, height] in CSS pixels.
style "modern", "classic", "system" "modern" host
theme "auto", "light", "dark", "system" "auto" host "auto": the style decides; "system": the host page or the operating system (STYLE-007).
skin object {} host Replaceable drawing parts: part name -> SVG source, sanitized (STYLE-005, STYLE-006).
show_legend boolean true host

Set by: host, the program (Python, Julia, ...); widget, the user through the widget; derived, computed from other traits by the host that owns the state, or by the widget. See the trait contract.