LinePlot
Introduction
LinePlot
widget in Supervisely is a widget that allows users to display one or more lines of data in a plot. It provides a canvas area that can be customized with various options, such as line smoothing, axis labels, and displaying legends. LinePlot
widget is useful for visualizing time-series data or data with continuous variables.
Function signature
or
Parameters
title
str
LinePlot
title
series
list
List of input data series
smoothing_weight
int
Smoothing
group_key
str
Synced charts key
show_legend
bool
Show legend on LinePlot
decimals_in_float
int
The number of fractions to display floating values in Y
axis
xaxis_decimals_in_float
int
The number of fractions to display floating values in X
axis
yaxis_interval
list
Min and max values on Y
axis (e.g. [0, 1])
yaxis_autorescale
bool
Set autoscaling of the Y
axis
widget_id
str
ID of the widget
title
Determine LinePlot
title.
type: str
series
Determine list of input data series.
type: list
default value: []
smoothing_weight
Determine LinePlot
smoothing.
type: int
default value: 0
group_key
Synced LinePlot
key.
type: str
default value: None
show_legend
Determine showing legend on LinePlot
.
type: bool
default value: True
decimals_in_float
The number of fractions to display floating values in Y
axis.
type: int
default value: 2
xaxis_decimals_in_float
The number of fractions to display floating values in X
axis.
type: int
default value: None
yaxis_interval
Determine min and max values on Y
axis (e.g. [0, 1]).
type: list
default value: None
yaxis_autorescale
Set autoscaling of the Y
axis.
type: bool
default value: True
widget_id
ID of the widget.
type: str
default value: None
Methods and attributes
update_y_range(ymin: int, ymax: int)
Update LinePlot
data.
add_series(name: str, x: list, y: list, send_changes: bool = True)
Add new series of data in LinePlot
.
add_series_batch(series: list)
Add new series of data in LinePlot
by batch.
add_to_series(name_or_id: str or int, data: List[tuple] or List[dict] or tuple or dict)
Add data to existing series.
get_series_by_name(name: str)
Return series data by name.
Mini App Example
You can find this example in our GitHub repository:
ui-widgets-demos/charts and plots/005_line_plot/src/main.py
Import libraries
Init API client
First, we load environment variables with credentials and init API for communicating with Supervisely Instance:
Prepare series for plot
Initialize LinePlot
widget
LinePlot
widgetCreate app layout
Prepare a layout for app using Card
widget with the content
parameter and place widget that we've just created in the Container
widget.
Create app using layout
Create an app object with layout parameter.
Last updated