plotly.express.line_ternary¶plotly.express.line_ternary(data_frame=None, a=None, b=None, c=None, color=None, line_dash=None, line_group=None, symbol=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, line_dash_sequence=None, line_dash_map=None, symbol_sequence=None, symbol_map=None, markers=False, line_shape=None, title=None, subtitle=None, template=None, width=None, height=None) → plotly.graph_objects._figure.Figure¶In a ternary line plot, each row of
data_frameis represented as a vertex of a polyline mark in ternary coordinates.
data_frame (DataFrame or array-like or dict) – This argument needs to be passed for column names (and not keyword names) to be used. Array-like and dict are transformed internally to a pandas DataFrame. Optional: if missing, a DataFrame gets constructed under the hood using the other arguments.
a (str or int or Series or array-like) – Either a name of a column in data_frame, or a pandas Series or
array_like object. Values from this column or array_like are used to
position marks along the a axis in ternary coordinates.
b (str or int or Series or array-like) – Either a name of a column in data_frame, or a pandas Series or
array_like object. Values from this column or array_like are used to
position marks along the b axis in ternary coordinates.
c (str or int or Series or array-like) – Either a name of a column in data_frame, or a pandas Series or
array_like object. Values from this column or array_like are used to
position marks along the c axis in ternary coordinates.
color (str or int or Series or array-like) – Either a name of a column in data_frame, or a pandas Series or
array_like object. Values from this column or array_like are used to
assign color to marks.
line_dash (str or int or Series or array-like) – Either a name of a column in data_frame, or a pandas Series or
array_like object. Values from this column or array_like are used to
assign dash-patterns to lines.
line_group (str or int or Series or array-like) – Either a name of a column in data_frame, or a pandas Series or
array_like object. Values from this column or array_like are used to
group rows of data_frame into lines.
symbol (str or int or Series or array-like) – Either a name of a column in data_frame, or a pandas Series or
array_like object. Values from this column or array_like are used to
assign symbols to marks.
hover_name (str or int or Series or array-like) – Either a name of a column in data_frame, or a pandas Series or
array_like object. Values from this column or array_like appear in bold
in the hover tooltip.
hover_data (str, or list of str or int, or Series or array-like, or dict) – Either a name or list of names of columns in data_frame, or pandas
Series, or array_like objects or a dict with column names as keys, with
values True (for default formatting) False (in order to remove this
column from hover information), or a formatting string, for example
‘:.3f’ or ‘|%a’ or list-like data to appear in the hover tooltip or
tuples with a bool or formatting string as first element, and list-like
data to appear in hover as second element Values from these columns
appear as extra data in the hover tooltip.
custom_data (str, or list of str or int, or Series or array-like) – Either name or list of names of columns in data_frame, or pandas
Series, or array_like objects Values from these columns are extra data,
to be used in widgets or Dash callbacks for example. This data is not
user-visible but is included in events emitted by the figure (lasso
selection etc.)
text (str or int or Series or array-like) – Either a name of a column in data_frame, or a pandas Series or
array_like object. Values from this column or array_like appear in the
figure as text labels.
animation_frame (str or int or Series or array-like) – Either a name of a column in data_frame, or a pandas Series or
array_like object. Values from this column or array_like are used to
assign marks to animation frames.
animation_group (str or int or Series or array-like) – Either a name of a column in data_frame, or a pandas Series or
array_like object. Values from this column or array_like are used to
provide object-constancy across animation frames: rows with matching
`animation_group`s will be treated as if they describe the same object
in each frame.
category_orders (dict with str keys and list of str values (default {})) – By default, in Python 3.6+, the order of categorical values in axes,
legends and facets depends on the order in which these values are first
encountered in data_frame (and no order is guaranteed by default in
Python below 3.6). This parameter is used to force a specific ordering
of values per column. The keys of this dict should correspond to column
names, and the values should be lists of strings corresponding to the
specific display order desired.
labels (dict with str keys and str values (default {})) – By default, column names are used in the figure for axis titles, legend
entries and hovers. This parameter allows this to be overridden. The
keys of this dict should correspond to column names, and the values
should correspond to the desired label to be displayed.
color_discrete_sequence (list of str) – Strings should define valid CSS-colors. When color is set and the
values in the corresponding column are not numeric, values in that
column are assigned colors by cycling through color_discrete_sequence
in the order described in category_orders, unless the value of
color is a key in color_discrete_map. Various useful color
sequences are available in the plotly.express.colors submodules,
specifically plotly.express.colors.qualitative.
color_discrete_map (dict with str keys and str values (default {})) – String values should define valid CSS-colors Used to override
color_discrete_sequence to assign a specific colors to marks
corresponding with specific values. Keys in color_discrete_map should
be values in the column denoted by color. Alternatively, if the
values of color are valid colors, the string 'identity' may be
passed to cause them to be used directly.
line_dash_sequence (list of str) – Strings should define valid plotly.js dash-patterns. When line_dash
is set, values in that column are assigned dash-patterns by cycling
through line_dash_sequence in the order described in
category_orders, unless the value of line_dash is a key in
line_dash_map.
line_dash_map (dict with str keys and str values (default {})) – Strings values define plotly.js dash-patterns. Used to override
line_dash_sequences to assign a specific dash-patterns to lines
corresponding with specific values. Keys in line_dash_map should be
values in the column denoted by line_dash. Alternatively, if the
values of line_dash are valid line-dash names, the string
'identity' may be passed to cause them to be used directly.
symbol_sequence (list of str) – Strings should define valid plotly.js symbols. When symbol is set,
values in that column are assigned symbols by cycling through
symbol_sequence in the order described in category_orders, unless
the value of symbol is a key in symbol_map.
symbol_map (dict with str keys and str values (default {})) – String values should define plotly.js symbols Used to override
symbol_sequence to assign a specific symbols to marks corresponding
with specific values. Keys in symbol_map should be values in the
column denoted by symbol. Alternatively, if the values of symbol
are valid symbol names, the string 'identity' may be passed to cause
them to be used directly.
markers (boolean (default False)) – If True, markers are shown on lines.
line_shape (str (default 'linear')) – One of 'linear', 'spline', 'hv', 'vh', 'hvh', or 'vhv'
title (str) – The figure title.
subtitle (str) – The figure subtitle.
template (str or dict or plotly.graph_objects.layout.Template instance) – The figure template name (must be a key in plotly.io.templates) or definition.
width (int (default None)) – The figure width in pixels.
height (int (default None)) – The figure height in pixels.