Loading...

verticapy.vDataFrame.animated_plot#

vDataFrame.animated_plot(ts: str, columns: str | list[str] | None = None, 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, window_size: int = 100, step: int = 5, fixed_xy_lim: bool = False, 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 line 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.

step: int, optional

Number of elements used to update the time series.

window_size: int, optional

Size of the window used to draw the time series.

fixed_xy_lim: bool, optional

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

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:

commodities = vpd.load_commodities()

Now we can finally create the plot:

commodities.animated_plot(ts = "date")

See also

vDataFrame.animated_pie() : Animated Pie Chart.
vDataFrame.plot() : Line Plot.