{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "2923956c-f141-4ecb-ab08-e819099f0fa9",
   "metadata": {
    "tags": [
     "hide"
    ]
   },
   "outputs": [],
   "source": [
    "import seaborn.objects as so\n",
    "from seaborn import load_dataset\n",
    "seaice = load_dataset(\"seaice\")"
   ]
  },
  {
   "cell_type": "raw",
   "id": "09694cb8-4867-49fc-80a6-a4551e50b77e",
   "metadata": {},
   "source": [
    "Like :class:`Line`, the mark draws a connecting line between sorted observations:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "acd5788f-e62b-497c-a109-f0bc02b8cae9",
   "metadata": {},
   "outputs": [],
   "source": [
    "so.Plot(seaice, \"Date\", \"Extent\").add(so.Lines())"
   ]
  },
  {
   "cell_type": "raw",
   "id": "8f982f2d-1119-4842-9860-80b415fd24fe",
   "metadata": {},
   "source": [
    "Compared to :class:`Line`, this mark offers fewer settable properties, but it can have better performance when drawing a large number of lines:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "d4411136-1787-47ca-91f4-4ecba541e575",
   "metadata": {},
   "outputs": [],
   "source": [
    "(\n",
    "    so.Plot(\n",
    "        x=seaice[\"Date\"].dt.day_of_year,\n",
    "        y=seaice[\"Extent\"],\n",
    "        color=seaice[\"Date\"].dt.year\n",
    "    )\n",
    "    .facet(seaice[\"Date\"].dt.year.round(-1))\n",
    "    .add(so.Lines(linewidth=.5, color=\"#bbca\"), col=None)\n",
    "    .add(so.Lines(linewidth=1))\n",
    "    .scale(color=\"ch:rot=-.2,light=.7\")\n",
    "    .layout(size=(8, 4))\n",
    "    .label(title=\"{}s\".format)\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "aaab3914-77d7-4d09-bdbe-f057a2fe28cf",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "py310",
   "language": "python",
   "name": "py310"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
