vastorbit.VastFrame.animated_plot¶
- VastFrame.animated_plot(ts: str, columns: Annotated[str | list[str], 'STRING representing one column or a list of columns'] | None = None, by: str | None = None, start_date: Annotated[bool | float | str | timedelta | datetime, 'Python Scalar'] | None = None, end_date: Annotated[bool | float | str | timedelta | datetime, 'Python Scalar'] | 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 | Figure | None = None, **style_kwargs) PlottingBase | TableSample | Axes | mFigure | Figure¶
Draws the animated line plot.
- Parameters:
ts (str) – TS (Time Series) VastColumn used to order the data. The VastColumn type must be date (date, datetime, timestamp…) or numerical.
columns (SQLColumns, optional) – List of the VastColumns names.
by (str, optional) – Categorical VastColumn 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:
Plotting Object.
- Return type:
obj
Examples
Note
The below example is a very basic one. For other more detailed examples and customization options, please see Animated Plots
Let’s begin by importing vastorbit.
import vastorbit as vo import vastorbit.datasets as vod
Let’s import the dataset:
commodities = vod.load_commodities()
Now we can finally create the plot:
commodities.animated_plot(ts = "date")
See also
VastFrame.animated_pie(): Animated Pie Chart.VastFrame.plot(): Line Plot.