# Line Chart

A line chart displays the evolution of one or several numeric variables. It is one of the most common chart type, so it can be build using any python viz library, like `matplotlib`

, `seaborn`

or `plotly`

.

## ⏱ Quick start

Making a simple line chart with `matplotlib`

is pretty straightforward thanks to the `plot()`

function.

If you provide only a series of values, it will consider that these values are ordered and will use values from 1 to n to create the X axis.🔥

For more control on the chart, see the dedicated section below.

```
# libraries
import matplotlib.pyplot as plt
import numpy as np
# create data
values=np.cumsum(np.random.randn(1000,1))
# use the plot function
plt.plot(values)
```

## Line chart with `Matplotlib`

`Matplotlib`

is a great fit to build line charts thanks to its `plot()`

function. The first chart of this section explains how to use `plot()`

from any kind of data input format. The next one goes deep into chart customization (line width, color aspect and more).

## Line chart with several groups (`Matplotlib`

)

A line chart with multiple groups allows to show the evolution of several items on the same figure. It is powerful but can quickly turn into a spaghetti chart: when too many lines are displayed they get hard to read. The examples below explain how to build one, and what are the alternative to show your data a better way.

## Contact

👋 This document is a work by Yan Holtz. Any feedback is highly encouraged. You can fill an issue on Github, drop me a message onTwitter, or send an email pasting `yan.holtz.data`

with `gmail.com`

.