# xarray.plot.line

### xarray.plot.line(darray, \*args, row=None, col=None, figsize=None, aspect=None, size=None, ax=None, hue=None, x=None, y=None, xincrease=None, yincrease=None, xscale=None, yscale=None, xticks=None, yticks=None, xlim=None, ylim=None, add_legend=True, \_labels=True, \*\*kwargs)[[source]](https://github.com/pydata/xarray/blob/main/xarray/plot/dataarray_plot.py#L421-L582)

Line plot of DataArray values.

Wraps [`matplotlib.pyplot.plot()`](https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.plot.html#matplotlib.pyplot.plot).

* **Parameters:**
  * **darray** ([`DataArray`](xarray.DataArray.html.md#xarray.DataArray)) – Either 1D or 2D. If 2D, one of `hue`, `x` or `y` must be provided.
  * **row** (`Hashable`, *optional*) – If passed, make row faceted plots on this dimension name.
  * **col** (`Hashable`, *optional*) – If passed, make column faceted plots on this dimension name.
  * **figsize** ([`tuple`](https://docs.python.org/3/builtins/stdtypes.html#tuple), *optional*) – A tuple (width, height) of the figure in inches.
    Mutually exclusive with `size` and `ax`.
  * **aspect** (`"auto"`, `"equal"`, [scalar](../user-guide/terminology.html.md#term-scalar) or [`None`](https://docs.python.org/3/builtins/constants.html#None), *optional*) – Aspect ratio of plot, so that `aspect * size` gives the *width* in
    inches. Only used if a `size` is provided.
  * **size** ([scalar](../user-guide/terminology.html.md#term-scalar), *optional*) – If provided, create a new figure for the plot with the given size:
    *height* (in inches) of each plot. See also: `aspect`.
  * **ax** ([`matplotlib axes object`](https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.html#matplotlib.axes.Axes), *optional*) – Axes on which to plot. By default, the current is used.
    Mutually exclusive with `size` and `figsize`.
  * **hue** (`Hashable`, *optional*) – Dimension or coordinate for which you want multiple lines plotted.
    If plotting against a 2D coordinate, `hue` must be a dimension.
  * **x, y** (`Hashable`, *optional*) – Dimension, coordinate or multi-index level for *x*, *y* axis.
    Only one of these may be specified.
    The other will be used for values from the DataArray on which this
    plot method is called.
  * **xincrease** ([`bool`](https://docs.python.org/3/builtins/functions.html#bool) or [`None`](https://docs.python.org/3/builtins/constants.html#None), *optional*) – Should the values on the *x* axis be increasing from left to right?
    if `None`, use the default for the Matplotlib function.
  * **yincrease** ([`bool`](https://docs.python.org/3/builtins/functions.html#bool) or [`None`](https://docs.python.org/3/builtins/constants.html#None), *optional*) – Should the values on the *y* axis be increasing from top to bottom?
    if `None`, use the default for the Matplotlib function.
  * **xscale, yscale** (`{'linear', 'symlog', 'log', 'logit'}`, *optional*) – Specifies scaling for the *x*- and *y*-axis, respectively.
  * **xticks, yticks** ([array-like](https://numpy.org/doc/stable/glossary.html#term-array_like), *optional*) – Specify tick locations for *x*- and *y*-axis.
  * **xlim, ylim** (`tuple[float`, `float]`, *optional*) – Specify *x*- and *y*-axis limits.
  * **add_legend** ([`bool`](https://docs.python.org/3/builtins/functions.html#bool), *default*: [`True`](https://docs.python.org/3/builtins/constants.html#True)) – Add legend with *y* axis coordinates (2D inputs only).
  * **\*args, \*\*kwargs** (**optional**) – Additional arguments to [`matplotlib.pyplot.plot()`](https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.plot.html#matplotlib.pyplot.plot).
* **Returns:**
  **primitive** ([`list`](https://docs.python.org/3/builtins/stdtypes.html#list) of `Line3D` or [`FacetGrid`](xarray.plot.FacetGrid.html.md#xarray.plot.FacetGrid)) – When either col or row is given, returns a FacetGrid, otherwise
  a list of matplotlib Line3D objects.

#### SEE ALSO
`Use`
: py:func:xarray.plot.lines for efficient plotting of many lines.
