Skip to contents

In a parallel coordinates plot, each row of data_frame is represented by a polyline mark which traverses a set of parallel axes, one for each of the dimensions.

Usage

px_parallel_coordinates(
  data_frame = NULL,
  dimensions = NULL,
  color = NULL,
  labels = NULL,
  color_continuous_scale = NULL,
  range_color = NULL,
  color_continuous_midpoint = NULL,
  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.

dimensions

Column names in data_frame (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 used for multidimensional visualization.

color

A column name in data_frame, a vector of values, a one-sided formula evaluated in data_frame (e.g. ~ log(pop)), px_constant() or px_range(). Values from this column or vector are used to assign color to marks.

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_continuous_scale

Character vector of colors, e.g. px_colors$sequential$Viridis, or the name of a scale in px_colors. Used when color is numeric. Defaults to the template's sequential colorscale.

range_color

If provided, overrides auto-scaling on the continuous color scale.

color_continuous_midpoint

If set, computes the bounds of the continuous color scale to have the desired midpoint. Setting this value is recommended when using plotly.express.colors.diverging color scales as the inputs to color_continuous_scale.

title

The figure title.

subtitle

The figure subtitle.

template

A template name (see template_names()) or a template list. Defaults to default_template().

width

The figure width in pixels.

height

The figure height in pixels.

Value

A go_figure().

Examples

px_data_iris() |>
  px_parallel_coordinates(color = ~species_id,
                          dimensions = ~c(sepal_width, sepal_length, petal_width, petal_length))