{
  "metadata": {
    "language_info": {
      "pygments_lexer": "ipython3",
      "version": "3.5.4",
      "name": "python",
      "nbconvert_exporter": "python",
      "codemirror_mode": {
        "name": "ipython",
        "version": 3
      },
      "file_extension": ".py",
      "mimetype": "text/x-python"
    },
    "kernelspec": {
      "name": "python3",
      "display_name": "Python 3",
      "language": "python"
    }
  },
  "nbformat": 4,
  "cells": [
    {
      "outputs": [],
      "execution_count": null,
      "source": [
        "%matplotlib inline"
      ],
      "cell_type": "code",
      "metadata": {
        "collapsed": false
      }
    },
    {
      "metadata": {},
      "cell_type": "markdown",
      "source": [
        "\n# Multiple lines from a 2d DataArray\n\n\n\nUse :py:func:`xarray.plot.line` on a 2d DataArray to plot selections as\nmultiple lines.\n\nSee `plotting.multiplelines` for more details.\n\n\n"
      ]
    },
    {
      "outputs": [],
      "execution_count": null,
      "source": [
        "import xarray as xr\nimport matplotlib.pyplot as plt\n\n# Load the data\nds = xr.tutorial.load_dataset('air_temperature')\nair = ds.air - 273.15  # to celsius\n\n# Prepare the figure\nf, (ax1, ax2) = plt.subplots(1, 2, figsize=(8, 4), sharey=True)\n\n# Selected latitude indices\nisel_lats = [10, 15, 20]\n\n# Temperature vs longitude plot - illustrates the \"hue\" kwarg\nair.isel(time=0, lat=isel_lats).plot.line(ax=ax1, hue='lat')\nax1.set_ylabel('\u00b0C')\n\n# Temperature vs time plot - illustrates the \"x\" and \"add_legend\" kwargs\nair.isel(lon=30, lat=isel_lats).plot.line(ax=ax2, x='time', add_legend=False)\nax2.set_ylabel('')\n\n# Show\nplt.tight_layout()\nplt.show()"
      ],
      "cell_type": "code",
      "metadata": {
        "collapsed": false
      }
    }
  ],
  "nbformat_minor": 0
}