vastorbit.VastColumn.plot¶
- VastColumn.plot(ts: str, 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, kind: Literal['area', 'area_percent', 'area_stacked', 'line', 'spline', 'step'] = 'line', chart: PlottingBase | TableSample | Axes | mFigure | Figure | None = None, **style_kwargs) PlottingBase | TableSample | Axes | mFigure | Figure¶
Draws the Time Series of the VastColumn.
- Parameters:
ts (str) – TS (Time Series) VastColumn used to order the data. The VastColumn type must be date like (date, datetime, timestamp…) or numerical.
by (str, optional) – VastColumn used to partition the TS.
start_date (str / PythonNumber / date, 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 (str / PythonNumber / date, optional) – Input End Date. For example, time = ‘03-11-1993’ will filter the data when ‘ts’ is greater than the 3rd of November 1993.
kind (str, optional) –
The plot type.
- line:
Line Plot.
- spline:
Spline Plot.
- step:
Step Plot.
- area_stacked:
Stacked Area Plot.
- area_percent:
Fully Stacked Area Plot.
chart (PlottingObject, optional) – The chart object to plot on.
**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 Line Plots
Let’s begin by importing vastorbit.
import vastorbit as vo
Let’s also import numpy to create a dataset.
import numpy as np
Let’s generate a dataset using the following data.
data = vo.VastFrame( { "date": [1900, 1950, 2000], "Asia": [947, 1402, 3634], "Africa": [133, 221, 767], "Europe": [408, 547, 729], "America": [156, 339, 818], "Oceania": [6, 13, 30], } )
Now we are ready to draw the plot:
data["Asia"].plot(ts = "date", kind = "spline")
See also
VastFrame.plot(): Line Plot.VastColumn.range_plot(): Range Plot.