In a polar line plot, each row of data_frame is represented as a vertex
of a polyline mark in polar coordinates.
Usage
px_line_polar(
data_frame = NULL,
r = NULL,
theta = NULL,
color = NULL,
line_dash = NULL,
hover_name = NULL,
hover_data = NULL,
custom_data = NULL,
line_group = NULL,
text = NULL,
symbol = NULL,
animation_frame = NULL,
animation_group = NULL,
category_orders = NULL,
labels = NULL,
color_discrete_sequence = NULL,
color_discrete_map = NULL,
line_dash_sequence = NULL,
line_dash_map = NULL,
symbol_sequence = NULL,
symbol_map = NULL,
markers = FALSE,
direction = "clockwise",
start_angle = 90,
line_close = FALSE,
line_shape = NULL,
render_mode = "auto",
range_r = NULL,
range_theta = NULL,
log_r = FALSE,
title = NULL,
subtitle = NULL,
template = NULL,
width = NULL,
height = NULL
)Arguments
- data_frame
A data.frame, data.table, list or matrix. Needed for column names to be used in the other arguments; if
NULL, a data frame is built from the vectors given in the other arguments.- r
A column name in
data_frame, a vector of values, a one-sided formula evaluated indata_frame(e.g.~ log(pop)),px_constant()orpx_range(). Values from this column or vector are used to position marks along the radial axis in polar coordinates.- theta
A column name in
data_frame, a vector of values, a one-sided formula evaluated indata_frame(e.g.~ log(pop)),px_constant()orpx_range(). Values from this column or vector are used to position marks along the angular axis in polar coordinates.- color
A column name in
data_frame, a vector of values, a one-sided formula evaluated indata_frame(e.g.~ log(pop)),px_constant()orpx_range(). Values from this column or vector are used to assign color to marks.- line_dash
A column name in
data_frame, a vector of values, a one-sided formula evaluated indata_frame(e.g.~ log(pop)),px_constant()orpx_range(). Values from this column or vector are used to assign dash-patterns to lines.- hover_name
A column name in
data_frame, a vector of values, a one-sided formula evaluated indata_frame(e.g.~ log(pop)),px_constant()orpx_range(). Values from this column or vector appear in bold in the hover tooltip.- hover_data
Extra data to show in the hover tooltip: column names (a character vector or a formula such as
~c(a, b)), or a named list with column names as names and valuesTRUE(default formatting),FALSE(hide the column, e.g. one shown by default), a d3-format string such as":.3f", a vector of data, or a list of a format string orTRUEand a vector of data.- custom_data
Column names (a character vector or a formula such as
~c(a, b)), or a list of column names, formulas and vectors. Values from these columns are added to the traces'customdata(e.g. for use in Shiny events) without appearing in the hover tooltip.- line_group
A column name in
data_frame, a vector of values, a one-sided formula evaluated indata_frame(e.g.~ log(pop)),px_constant()orpx_range(). Values from this column or vector are used to group rows ofdata_frameinto lines.- text
A column name in
data_frame, a vector of values, a one-sided formula evaluated indata_frame(e.g.~ log(pop)),px_constant()orpx_range(). Values from this column or vector appear in the figure as text labels.- symbol
A column name in
data_frame, a vector of values, a one-sided formula evaluated indata_frame(e.g.~ log(pop)),px_constant()orpx_range(). Values from this column or vector are used to assign symbols to marks.- animation_frame
A column name in
data_frame, a vector of values, a one-sided formula evaluated indata_frame(e.g.~ log(pop)),px_constant()orpx_range(). Values from this column or vector are used to assign marks to animation frames.- animation_group
A column name in
data_frame, a vector of values, a one-sided formula evaluated indata_frame(e.g.~ log(pop)),px_constant()orpx_range(). Values from this column or vector are used to provide object-constancy across animation frames: rows with matchinganimation_groups will be treated as if they describe the same object in each frame.- category_orders
Named list mapping column names to the order of their values in axes, legends and facets, e.g.
list(day = c("Thur", "Fri", "Sat", "Sun")). By default values appear in the order first encountered, or in level order for factors.- labels
Named character vector or list mapping column names to the labels to use for axis titles, legend entries and hover text, e.g.
c(gdpPercap = "GDP per capita").- color_discrete_sequence
Character vector of colors, e.g.
px_colors$qualitative$Set1. Values ofcolorare assigned colors in order (cycling), unless set incolor_discrete_map. Defaults to the template'scolorway.- color_discrete_map
Named character vector or list mapping values of
colorto colors, overridingcolor_discrete_sequence. If the values ofcolorare colors,px_identity()(or"identity") uses them directly.- line_dash_sequence
Strings should define valid plotly.js dash-patterns. When
line_dashis set, values in that column are assigned dash-patterns by cycling throughline_dash_sequencein the order described incategory_orders, unless the value ofline_dashis a key inline_dash_map.- line_dash_map
Named character vector or list mapping values of
line_dashto dash patterns, overridingline_dash_sequence.px_identity()uses the values ofline_dashdirectly.- symbol_sequence
Strings should define valid plotly.js symbols. When
symbolis set, values in that column are assigned symbols by cycling throughsymbol_sequencein the order described incategory_orders, unless the value ofsymbolis a key insymbol_map.- symbol_map
Named character vector or list mapping values of
symbolto marker symbols, overridingsymbol_sequence.px_identity()uses the values ofsymboldirectly.- markers
If
TRUE, markers are shown on lines.- direction
One of "
counterclockwise"or"clockwise". Default is"clockwise"Sets the direction in which increasing values of the angular axis are drawn.- start_angle
Sets start angle for the angular axis, with 0 being due east and 90 being due north.
- line_close
If
TRUE, an extra line segment is drawn between the first and last point.- line_shape
One of
"linear","spline","hv","vh","hvh", or"vhv"- render_mode
One of
"auto","svg"or"webgl", default"auto"Controls the browser API used to draw marks."svg"is appropriate for figures of less than 1000 data points, and will allow for fully-vectorized output."webgl"is likely necessary for acceptable performance above 1000 points but rasterizes part of the output."auto"uses heuristics to choose the mode.- range_r
If provided, overrides auto-scaling on the radial axis in polar coordinates.
- range_theta
If provided, overrides auto-scaling on the angular axis in polar coordinates.
- log_r
If
TRUE, the radial axis is log-scaled in polar coordinates.- title
The figure title.
- subtitle
The figure subtitle.
- template
A template name (see
template_names()) or a template list. Defaults todefault_template().- width
The figure width in pixels.
- height
The figure height in pixels.
Value
A go_figure().
See also
Other plotly express:
px_area(),
px_bar(),
px_bar_polar(),
px_box(),
px_choropleth(),
px_choropleth_map(),
px_density_contour(),
px_density_heatmap(),
px_density_map(),
px_ecdf(),
px_funnel(),
px_funnel_area(),
px_histogram(),
px_icicle(),
px_imshow(),
px_line(),
px_line_3d(),
px_line_geo(),
px_line_map(),
px_line_ternary(),
px_parallel_categories(),
px_parallel_coordinates(),
px_pie(),
px_scatter(),
px_scatter_3d(),
px_scatter_geo(),
px_scatter_map(),
px_scatter_matrix(),
px_scatter_polar(),
px_scatter_ternary(),
px_strip(),
px_sunburst(),
px_timeline(),
px_treemap(),
px_violin()
Examples
px_data_wind() |>
px_line_polar(r = ~frequency, theta = ~direction, color = ~strength, line_close = TRUE)