{
  "cells": [
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "%matplotlib inline"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "\n# Custom Node Positions and Edge Paths\n\nNode positions can be set explicitly by using a dictionary that maps\nnode IDs to (x, y) coordinates as the :code:`node_layout` keyword argument.\n\nAnalogously, edge paths can be set explicitly by using a dictionary that maps\nedge IDs to ndarray of (x, y) coordinates as the :code:`edge_layout` keyword argument.\n\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "import numpy as np\nimport matplotlib.pyplot as plt\n\nfrom netgraph import Graph\n\nedge_list = [(0, 1)]\nnode_positions = {\n    0 : (0.2, 0.4),\n    1 : (0.8, 0.6)\n}\nedge_paths = {\n    (0, 1) : np.array([(0.2, 0.4), (0.2, 0.8), (0.5, 0.8), (0.5, 0.2), (0.8, 0.2), (0.8, 0.6)])\n}\n\nGraph(edge_list, node_layout=node_positions, edge_layout=edge_paths)\nplt.show()"
      ]
    }
  ],
  "metadata": {
    "kernelspec": {
      "display_name": "Python 3",
      "language": "python",
      "name": "python3"
    },
    "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.6.8"
    }
  },
  "nbformat": 4,
  "nbformat_minor": 0
}