{
 "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",
    "networks = (\n",
    "    load_dataset(\"brain_networks\", header=[0, 1, 2], index_col=0)\n",
    "    .rename_axis(\"timepoint\")\n",
    "    .stack([0, 1, 2])\n",
    "    .groupby([\"timepoint\", \"network\", \"hemi\"])\n",
    "    .mean()\n",
    "    .unstack(\"network\")\n",
    "    .reset_index()\n",
    "    .query(\"timepoint < 100\")\n",
    ")"
   ]
  },
  {
   "cell_type": "raw",
   "id": "50646936-5236-413f-b79b-6c3b640ade04",
   "metadata": {},
   "source": [
    "Unlike :class:`Lines`, this mark does not sort observations before plotting, making it suitable for plotting trajectories through a variable space:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "4a3ed115-cc47-4ea8-be46-2c99f7453941",
   "metadata": {},
   "outputs": [],
   "source": [
    "p = (\n",
    "    so.Plot(networks)\n",
    "    .pair(\n",
    "        x=[\"5\", \"8\", \"12\", \"15\"],\n",
    "        y=[\"6\", \"13\", \"16\"],\n",
    "    )\n",
    "    .layout(size=(8, 5))\n",
    "    .share(x=True, y=True)\n",
    ")\n",
    "p.add(so.Paths())"
   ]
  },
  {
   "cell_type": "raw",
   "id": "5bf502eb-feb3-4b2e-882b-3e915bf5d041",
   "metadata": {},
   "source": [
    "The mark has the same set of properties as :class:`Lines`:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "326a765b-59f0-46ef-91c2-6705c6893740",
   "metadata": {},
   "outputs": [],
   "source": [
    "p.add(so.Paths(linewidth=1, alpha=.8), color=\"hemi\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "175b836d-d328-4b6c-ad36-dde18c19e3bf",
   "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
}
