---
title: area
description: "PySparkPlotAccessor.area method in PySpark: Draws a stacked area plot."
canonical_url: https://docs.databricks.com/gcp/en/pyspark/reference/classes/plotaccessor/area
---

# area

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

```python
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'])
```
