vDataFrame[].plot¶
In [ ]:
vDataFrame[].plot(ts: str,
columns: list = [],
by: str = "",
start_date: (str, datetime.datetime, datetime.date, float,) = "",
end_date: (str, datetime.datetime, datetime.date, float,) = "",
area: bool = False,
step: bool = False,
**style_kwds,)
Draws a time series of the vcolumn.
Parameters¶
| Name | Type | Optional | Description |
|---|---|---|---|
ts | str | ❌ | TS (Time Series) vcolumn to use to order the data. The vcolumn type must be date like (date, datetime, timestamp...) or numerical. |
by | str | ✓ | vcolumn to use to partition the TS. |
start_date | str / date / float | ✓ | Input Start Date. For example, time = '03-11-1993' will filter the data when 'ts' is lesser than November 1993 the 3rd. |
end_date | str / date / float | ✓ | Input End Date. For example, time = '03-11-1993' will filter the data when 'ts' is greater than November 1993 the 3rd. |
color | str | ✓ | Color of the TS. |
area | bool | ✓ | If set to True, draw an Area Plot. |
step | bool | ✓ | If set to True, draw a Step Plot. |
ax | Matplotlib axes object | ✓ | The axes to plot on. |
**style_kwds | any | ✓ | Any optional parameter to pass to the Matplotlib functions. |
In [7]:
from verticapy.datasets import load_amazon
amazon = load_amazon()
display(amazon)
In [8]:
# Forest fires in Rio and Sao Paulo
amazon.filter("state IN ('AMAZONAS', 'BAHIA')")
amazon["number"].plot(ts = "date", by = "state")
Out[8]:
In [9]:
# Forest fires in Rio and Sao Paulo - Step Plot
amazon.filter("state IN ('AMAZONAS', 'BAHIA')")
amazon["number"].plot(ts = "date", by = "state", step = True)
Out[9]:
See Also¶
| vDataFrame.plot | Draws the Time Series. |
