Loading...

verticapy.vDataFrame.animated_scatter#

vDataFrame.animated_scatter(ts: str, columns: str | list[str], by: str | None = None, start_date: bool | float | str | timedelta | datetime | None = None, end_date: bool | float | str | timedelta | datetime | None = None, limit_over: int = 6, limit: int = 1000000, limit_labels: int = 6, bbox: list | None = None, img: str | None = None, fixed_xy_lim: bool = False, date_in_title: bool = False, date_f=None, date_style_dict: dict | None = None, interval: int = 300, repeat: bool = True, chart: PlottingBase | TableSample | Axes | mFigure | Highchart | Highstock | Figure | None = None, **style_kwargs) PlottingBase | TableSample | Axes | mFigure | Highchart | Highstock | Figure#

Draws the animated scatter plot.

Parameters#

ts: str

TS (Time Series) vDataColumn used to order the data. The vDataColumn type must be date (date, datetime, timestamp…) or numerical.

columns: SQLColumns, optional

List of the vDataColumns names.

by: str, optional

Categorical vDataColumn used in the partition.

start_date: PythonScalar, optional

Input Start Date. For example, time = ‘03-11-1993’ will filter the data when ‘ts’ is less than the 3rd of November 1993.

end_date: PythonScalar, optional

Input End Date. For example, time = ‘03-11-1993’ will filter the data when ‘ts’ is greater than the 3rd of November 1993.

limit_over: int, optional

Limited number of elements to consider for each category.

limit: int, optional

Maximum number of data points to use.

limit_labels: int, optional

Maximum number of text labels to draw.

img: str, optional

Path to the image to display as background.

bbox: list, optional

List of 4 elements to delimit the boundaries of the final Plot. It must be similar the following list: [xmin, xmax, ymin, ymax]

fixed_xy_lim: bool, optional

If set to True, the xlim and ylim are fixed.

date_in_title: bool, optional

If set to True, the ts vDataColumn is displayed in the title section.

date_f: function, optional

Function used to display the ts vDataColumn.

date_style_dict: dict, optional

Style Dictionary used to display the ts vDataColumn when date_in_title = False.

interval: int, optional

Number of ms between each update.

repeat: bool, optional

If set to True, the animation is repeated.

chart: PlottingObject, optional

The chart object used to plot.

**style_kwargs

Any optional parameter to pass to the plotting functions.

Returns#

obj

Plotting Object.

Examples#

Note

The below example is a very basic one. For other more detailed examples and customization options, please see :ref:`chart_gallery.animated`_

Let’s begin by importing VerticaPy.

import verticapy as vp

import verticapy.datasets as vpd

Let’s import the dataset:

gapminder = vpd.load_gapminder()
gapminder.animated_scatter(
  ts = "year",
  columns = ["lifeExp", "gdpPercap"],
  by = "country",
  start_date = 1952,
  end_date = 2000,
)

See also

vDataFrame.animated_pie() : Animated Pie Chart.
vDataFrame.scatter() : Scatter Plot.