Plot radial and angular measurements
Directional measurements such as wind observations or bearings.
Plotly · Function
Creates an interactive polar scatter plot, mapping observations to radial and angular coordinates. Marker appearance can encode additional variables such as color, symbol, and size.
px.scatter_polar creates a Plotly figure whose points use radial coordinates from r and angular coordinates from theta. Optional encodings such as color, symbol, and size add visual dimensions, while range_theta, start_angle, and direction control the angular domain and orientation.
plotly.express.scatter_polar(data_frame=None, r=None, theta=None, color=None, symbol=None, size=None, hover_name=None, hover_data=None, custom_data=None, text=None, animation_frame=None, animation_group=None, category_orders=None, labels=None, color_discrete_sequence=None, color_discrete_map=None, color_continuous_scale=None, range_color=None, color_continuous_midpoint=None, symbol_sequence=None, symbol_map=None, opacity=None, size_max=None, marginal=None, trendline=None, trendline_options=None, trendline_color_override=None, trendline_scope=None, log_r=False, range_r=None, range_theta=None, start_angle=90, direction=None, log_theta=False, theta_order=None, height=None, width=None, template=None, facet_row=None, facet_col=None, facet_col_wrap=0, facet_row_spacing=None, facet_col_spacing=None, animation_opts=None, render_mode='auto', base=None, marks=None, title=None, subtitle=None, width=None, height=None)| Name | Type | Description |
|---|---|---|
data_frame | DataFrame or array-like | Optional data frame supplying columns used by the plot and its encodings. |
r | str or array-like | Radial coordinate values or a data-frame column name. |
theta | str or array-like | Angular coordinate values or a data-frame column name. |
color | str or array-like | Variable controlling marker color. |
symbol | str or array-like | Variable controlling marker symbol. |
size | str or array-like | Variable controlling marker size. |
range_theta | list or array-like | Angular interval to display. |
start_angle | number | Initial angular orientation. |
direction | str | Angular direction, such as clockwise or counterclockwise. |
render_mode | str | Rendering mode, including WebGL support. |
A Plotly Figure object representing a polar scatter plot.
import plotly.express as px
fig = px.scatter_polar(
r=[1, 2, 3, 2],
theta=[0, 90, 180, 270],
color=["a", "b", "a", "b"],
range_theta=[0, 360],
start_angle=0,
direction="counterclockwise",
)
fig.show()Creates a polar scatter figure from radial and angular coordinates, with point colors grouped by category.
Directional measurements such as wind observations or bearings.
Comparing categories around a circular domain.
Displaying a sector instead of a complete circle.
Rendering many polar points interactively.
It returns a Plotly Figure generated from radial and angular data. Each row of a supplied data frame becomes a plotted polar-scatter point, while r and theta identify its coordinates.
Follow-up: How would you orient a partial-circle chart? Set range_theta for the angular interval, then use start_angle and direction to control its orientation.
The function maps values in r to the radial axis and values in theta to the angular axis. Additional arguments can encode categories or magnitudes through properties such as color, symbol, and size.
Follow-up: Which arguments can restrict the angular display? Use range_theta for the interval; start_angle and direction adjust its orientation.
Plotly Express supports render_mode for scatter_polar, including WebGL rendering for larger point sets. The result remains a Plotly figure that can be displayed with fig.show().
Follow-up: What trade-off should be considered when enabling WebGL? It can improve rendering performance for many points, but it changes the rendering backend and may affect feature support.
px.line_polarpx.bar_polargo.Scatterpolarplotly.express