Skip to content

Commit

Permalink
Update recipes.ipynb
Browse files Browse the repository at this point in the history
  • Loading branch information
nwlandry committed May 2, 2024
1 parent 308560e commit 9999df3
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions docs/source/api/recipes/recipes.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -964,26 +964,22 @@
"import numpy as np\n",
"import itertools\n",
"\n",
"links = [[1, 2], [1, 3], [5, 6], [1, 7]]\n",
"triangles = [[3, 5, 7], [2, 7, 1], [6, 10, 15]]\n",
"squares = [[7, 8, 9, 10]]\n",
"pentagons = [[1, 11, 12, 13, 14]]\n",
"edges = links + triangles + squares + pentagons\n",
"\n",
"H = xgi.Hypergraph(edges)\n",
"\n",
"link_color = \"#000000\"\n",
"triangle_color = \"#648FFF\"\n",
"square_color = \"#785EF0\"\n",
"pentagon_color = \"#DC267F\"\n",
"colors = [link_color, triangle_color, square_color, pentagon_color]\n",
"\n",
"\n",
"def color_edges(H):\n",
" return [colors[i - 2] for i in H.edges.filterby(\"order\", 1, \"gt\").size.aslist()]\n",
"\n",
"\n",
"links = [[1, 2], [1, 3], [5, 6], [1, 7]]\n",
"triangles = [[3, 5, 7], [2, 7, 1], [6, 10, 15]]\n",
"squares = [[7, 8, 9, 10]]\n",
"pentagons = [[1, 11, 12, 13, 14]]\n",
"edges = links + triangles + squares + pentagons\n",
"H = xgi.Hypergraph(edges)\n",
"\n",
"# This computes the positions used for all of the subplots\n",
"pos = xgi.pca_transform(xgi.pairwise_spring_layout(H, seed=3))\n",
"\n",
Expand Down

0 comments on commit 9999df3

Please sign in to comment.