ScatterChart
Introduction
ScatterChart
is a widget in Supervisely used to display a scatter plot of numerical data. It can be used to visualize the relationship between two variables in a dataset, with each point on the plot representing a data point in the dataset. It is commonly used in data exploration and analysis tasks.
Function signature
or
Parameters
title
str
ScatterChart
title
series
list
List of input data series
zoom
bool
Enable zoom on
markers_size
int
Set point markers size
data_labels
bool
If True
it will display Y
value of data for each datapoint
xaxis_type
Literal["numeric", "category", "datetime"]
Set type of divisions on X
axis
xaxis_title
str
Set title for the X
axis
yaxis_title
str
Set title for the Y
axis
yaxis_autorescale
bool
Set autoscaling of the Y
axis
height
Union[int, str]
Widget height
decimalsInFloat
int
Set number of decimals in float values of Y
axis
widget_id
str
ID of the widget
title
Chart title
type: str
series
List of input data series
type: list
zoom
Enable zoom on
type: bool
markers_size
Set point markers size
type: int
data_labels
If True
it will display Y
value of data for each datapoint
type: bool
xaxis_type
Set type of divisions on X
axis
type: Literal["numeric", "category", "datetime"]
xaxis_title
Set title for the X
axis
type: str
yaxis_title
Set title for the Y
axis
type: str
yaxis_autorescale
Set autoscaling of the Y
axis
type: bool
height
Widget height
type: Union[int, str]
decimalsInFloat
Set number of decimals in float values of Y
axis
type: int
widget_id
ID of the widget.
type: str
default value: None
Methods and attributes
update_y_range(ymin: int, ymax: int)
Update chart Y
axis range.
add_series(name: str, x: list, y: list)
Add new series of data in ScatterChart
.
add_series_batch(series: dict)
Add new series of data in ScatterChart
by batch.
add_points_to_serie(name: str, x: Union[list, int], y: Union[list, int])
Add points to series .
Mini App Example
You can find this example in our Github repository:
ui-widgets-demos/charts and plots/007_scatter_chart/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 chart
Initialize ScatterChart
widget
ScatterChart
widgetCreate Text
widget
Text
widgetCreate app layout
Prepare a layout for the app using Card
widget with the content
parameter and place the widget that we've just created in the Container
widget.
Create app using layout
Create an app object with layout parameter.
Add functions to control widgets from code
Last updated