Lưu ý
Cần có ủy quyền mới truy nhập được vào trang này. Bạn có thể thử đăng nhập hoặc thay đổi thư mục.
Cần có ủy quyền mới truy nhập được vào trang này. Bạn có thể thử thay đổi thư mục.
Draws a stacked area plot.
An area plot displays quantitative data visually.
Syntax
area(x, y, **kwargs)
Parameters
| Parameter | Type | Description |
|---|---|---|
x |
str | Name of column to use for the horizontal axis. |
y |
str or list of str | Name(s) of the column(s) to plot. |
**kwargs |
optional | Additional keyword arguments. |
Returns
plotly.graph_objs.Figure
Examples
from pyspark.sql import SparkSession
from datetime import datetime
spark = SparkSession.builder.getOrCreate()
data = [
(3, 5, 20, datetime(2018, 1, 31)),
(2, 5, 42, datetime(2018, 2, 28)),
(3, 6, 28, datetime(2018, 3, 31)),
(9, 12, 62, datetime(2018, 4, 30))
]
columns = ["sales", "signups", "visits", "date"]
df = spark.createDataFrame(data, columns)
df.plot.area(x='date', y=['sales', 'signups', 'visits'])