verticapy.vDataColumn.plot#
- vDataColumn.plot(ts: str, by: str | None = None, start_date: bool | float | str | timedelta | datetime | None = None, end_date: bool | float | str | timedelta | datetime | None = None, kind: Literal['area', 'area_percent', 'area_stacked', 'line', 'spline', 'step'] = 'line', chart: PlottingBase | TableSample | Axes | mFigure | Highchart | Highstock | Figure | None = None, **style_kwargs) PlottingBase | TableSample | Axes | mFigure | Highchart | Highstock | Figure #
Draws the Time Series of the vDataColumn.
Parameters#
- ts: str
TS (Time Series) vDataColumn used to order the data. The vDataColumn type must be date like (date, datetime, timestamp…) or numerical.
- by: str, optional
vDataColumn 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#
- obj
Plotting Object.
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 VerticaPy.
import verticapy as vp
Let’s also import numpy to create a dataset.
import numpy as np
Let’s generate a dataset using the following data.
data = vp.vDataFrame( { "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
vDataFrame.
plot()
: Line Plot.vDataColumn.
range_plot()
: Range Plot.