# xarray.DataArray.plot.lines

#### DataArray.plot.lines(\*args, x=None, y=None, z=None, hue=None, hue_style=None, markersize=None, linewidth=None, row=None, col=None, col_wrap=None, ax=None, figsize=None, size=None, aspect=None, xincrease=True, yincrease=True, add_legend=None, add_colorbar=None, add_labels=True, add_title=True, subplot_kws=None, xscale=None, yscale=None, xticks=None, yticks=None, xlim=None, ylim=None, cmap=None, vmin=None, vmax=None, norm=None, extend=None, levels=None, \*\*kwargs)[[source]](https://github.com/pydata/xarray/blob/v2026.09.0/xarray/plot/dataarray_plot.py#L860-L1105)

> Line plot of DataArray values.

> Wraps `matplotlib:matplotlib.collections.LineCollection()` which allows
> efficient plotting of many lines in a similar fashion to
> [`xarray.plot.scatter()`](xarray.plot.scatter.html.md#xarray.plot.scatter).
* **Parameters:**
  * **darray** ([`DataArray`](xarray.DataArray.html.md#xarray.DataArray)) – Must be 2 dimensional, unless creating faceted plots.
  * **x** (`Hashable` or [`None`](https://docs.python.org/3/builtins/constants.html#None), *optional*) – Coordinate for x axis. If None use darray.dims[1].
  * **y** (`Hashable` or [`None`](https://docs.python.org/3/builtins/constants.html#None), *optional*) – Coordinate for y axis. If None use darray.dims[0].
  * **z** (`Hashable` or [`None`](https://docs.python.org/3/builtins/constants.html#None), *optional*) – If specified plot 3D and use this coordinate for *z* axis.
  * **hue** (`Hashable` or [`None`](https://docs.python.org/3/builtins/constants.html#None), *optional*) – Dimension or coordinate for which you want multiple lines plotted.
  * **markersize** (`Hashable` or [`None`](https://docs.python.org/3/builtins/constants.html#None), *optional*) – scatter only. Variable by which to vary size of scattered points.
  * **linewidth** (`Hashable` or [`None`](https://docs.python.org/3/builtins/constants.html#None), *optional*) – Variable by which to vary linewidth.
  * **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.
  * **col_wrap** ([`int`](https://docs.python.org/3/builtins/functions.html#int), [`None`](https://docs.python.org/3/builtins/constants.html#None) or `"auto"`, *optional*) – “Wrap” the grid for the column variable after this number of columns,
    adding rows if `col_wrap` is less than the number of facets.
    If “auto” align the grid to the figsize or keep it as square as possible.
  * **ax** ([`matplotlib axes object`](https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.html#matplotlib.axes.Axes), *optional*) – If None, uses the current axis. Not applicable when using facets.
  * **figsize** (`Iterable[float]` or [`None`](https://docs.python.org/3/builtins/constants.html#None), *optional*) – A tuple (width, height) of the figure in inches.
    Mutually exclusive with `size` and `ax`.
  * **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`.
  * **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.
  * **xincrease** ([`bool`](https://docs.python.org/3/builtins/functions.html#bool) or [`None`](https://docs.python.org/3/builtins/constants.html#None), *default*: [`True`](https://docs.python.org/3/builtins/constants.html#True)) – Should the values on the x axes 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), *default*: [`True`](https://docs.python.org/3/builtins/constants.html#True)) – Should the values on the y axes be increasing from top to bottom?
    if None, use the default for the matplotlib function.
  * **add_legend** ([`bool`](https://docs.python.org/3/builtins/functions.html#bool) or [`None`](https://docs.python.org/3/builtins/constants.html#None), *optional*) – If True use xarray metadata to add a legend.
  * **add_colorbar** ([`bool`](https://docs.python.org/3/builtins/functions.html#bool) or [`None`](https://docs.python.org/3/builtins/constants.html#None), *optional*) – If True add a colorbar.
  * **add_labels** ([`bool`](https://docs.python.org/3/builtins/functions.html#bool) or [`None`](https://docs.python.org/3/builtins/constants.html#None), *optional*) – If True use xarray metadata to label axes
  * **add_title** ([`bool`](https://docs.python.org/3/builtins/functions.html#bool) or [`None`](https://docs.python.org/3/builtins/constants.html#None), *optional*) – If True use xarray metadata to add a title
  * **subplot_kws** ([`dict`](https://docs.python.org/3/builtins/stdtypes.html#dict), *optional*) – Dictionary of keyword arguments for matplotlib subplots. Only applies
    to FacetGrid plotting.
  * **xscale** (`{'linear', 'symlog', 'log', 'logit'}` or [`None`](https://docs.python.org/3/builtins/constants.html#None), *optional*) – Specifies scaling for the x-axes.
  * **yscale** (`{'linear', 'symlog', 'log', 'logit'}` or [`None`](https://docs.python.org/3/builtins/constants.html#None), *optional*) – Specifies scaling for the y-axes.
  * **xticks** (`ArrayLike` or [`None`](https://docs.python.org/3/builtins/constants.html#None), *optional*) – Specify tick locations for x-axes.
  * **yticks** (`ArrayLike` or [`None`](https://docs.python.org/3/builtins/constants.html#None), *optional*) – Specify tick locations for y-axes.
  * **xlim** (`tuple[float`, `float]` or [`None`](https://docs.python.org/3/builtins/constants.html#None), *optional*) – Specify x-axes limits.
  * **ylim** (`tuple[float`, `float]` or [`None`](https://docs.python.org/3/builtins/constants.html#None), *optional*) – Specify y-axes limits.
  * **cmap** ([matplotlib colormap name](https://matplotlib.org/stable/gallery/color/colormap_reference.html) or [`colormap`](https://matplotlib.org/stable/api/_as_gen/matplotlib.colors.Colormap.html#matplotlib.colors.Colormap), *optional*) – The mapping from data values to color space. Either a
    Matplotlib colormap name or object. If not provided, this will
    be either `'viridis'` (if the function infers a sequential
    dataset) or `'RdBu_r'` (if the function infers a diverging
    dataset).
    See [Choosing Colormaps in Matplotlib](https://matplotlib.org/stable/users/explain/colors/colormaps.html)
    for more information.

    If *seaborn* is installed, `cmap` may also be a
    [seaborn color palette](https://seaborn.pydata.org/tutorial/color_palettes.html).
    Note: if `cmap` is a seaborn color palette,
    `levels` must also be specified.
  * **vmin** ([`float`](https://docs.python.org/3/builtins/functions.html#float) or [`None`](https://docs.python.org/3/builtins/constants.html#None), *optional*) – Lower value to anchor the colormap, otherwise it is inferred from the
    data and other keyword arguments. When a diverging dataset is inferred,
    setting vmin or vmax will fix the other by symmetry around
    `center`. Setting both values prevents use of a diverging colormap.
    If discrete levels are provided as an explicit list, both of these
    values are ignored.
  * **vmax** ([`float`](https://docs.python.org/3/builtins/functions.html#float) or [`None`](https://docs.python.org/3/builtins/constants.html#None), *optional*) – Upper value to anchor the colormap, otherwise it is inferred from the
    data and other keyword arguments. When a diverging dataset is inferred,
    setting vmin or vmax will fix the other by symmetry around
    `center`. Setting both values prevents use of a diverging colormap.
    If discrete levels are provided as an explicit list, both of these
    values are ignored.
  * **norm** ([`matplotlib.colors.Normalize`](https://matplotlib.org/stable/api/_as_gen/matplotlib.colors.Normalize.html#matplotlib.colors.Normalize), *optional*) – If `norm` has `vmin` or `vmax` specified, the corresponding
    kwarg must be `None`.
  * **extend** (`{'neither', 'both', 'min', 'max'}`, *optional*) – How to draw arrows extending the colorbar beyond its limits. If not
    provided, `extend` is inferred from `vmin`, `vmax` and the data limits.
  * **levels** ([`int`](https://docs.python.org/3/builtins/functions.html#int) or [array-like](https://numpy.org/doc/stable/glossary.html#term-array_like), *optional*) – Split the colormap (`cmap`) into discrete color intervals. If an integer
    is provided, “nice” levels are chosen based on the data range: this can
    imply that the final number of levels is not exactly the expected one.
    Setting `vmin` and/or `vmax` with `levels=N` is equivalent to
    setting `levels=np.linspace(vmin, vmax, N)`.
  * **\*\*kwargs** (**optional**) – Additional arguments to wrapped matplotlib function
* **Returns:**
  `artist` – The same type of primitive artist that the wrapped matplotlib
  function returns
