Diagram1.ipynb (3490B)
1 { 2 "cells": [ 3 { 4 "cell_type": "code", 5 "execution_count": 9, 6 "metadata": {}, 7 "outputs": [ 8 { 9 "data": { 10 "image/svg+xml": [ 11 "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n", 12 "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n", 13 " \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n", 14 "<!-- Generated by graphviz version 2.43.0 (0)\n", 15 " -->\n", 16 "<!-- Title: %3 Pages: 1 -->\n", 17 "<svg width=\"134pt\" height=\"116pt\"\n", 18 " viewBox=\"0.00 0.00 134.00 116.00\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n", 19 "<g id=\"graph0\" class=\"graph\" transform=\"scale(1 1) rotate(0) translate(4 112)\">\n", 20 "<title>%3</title>\n", 21 "<polygon fill=\"white\" stroke=\"transparent\" points=\"-4,4 -4,-112 130,-112 130,4 -4,4\"/>\n", 22 "<!-- A -->\n", 23 "<g id=\"node1\" class=\"node\">\n", 24 "<title>A</title>\n", 25 "<ellipse fill=\"none\" stroke=\"black\" cx=\"63\" cy=\"-90\" rx=\"27\" ry=\"18\"/>\n", 26 "<text text-anchor=\"middle\" x=\"63\" y=\"-86.3\" font-family=\"Times,serif\" font-size=\"14.00\">A</text>\n", 27 "</g>\n", 28 "<!-- B -->\n", 29 "<g id=\"node2\" class=\"node\">\n", 30 "<title>B</title>\n", 31 "<ellipse fill=\"none\" stroke=\"black\" cx=\"27\" cy=\"-18\" rx=\"27\" ry=\"18\"/>\n", 32 "<text text-anchor=\"middle\" x=\"27\" y=\"-14.3\" font-family=\"Times,serif\" font-size=\"14.00\">B</text>\n", 33 "</g>\n", 34 "<!-- A->B -->\n", 35 "<g id=\"edge2\" class=\"edge\">\n", 36 "<title>A->B</title>\n", 37 "<path fill=\"none\" stroke=\"black\" d=\"M54.65,-72.76C50.29,-64.28 44.85,-53.71 39.96,-44.2\"/>\n", 38 "<polygon fill=\"black\" stroke=\"black\" points=\"42.99,-42.44 35.3,-35.15 36.77,-45.64 42.99,-42.44\"/>\n", 39 "</g>\n", 40 "<!-- C -->\n", 41 "<g id=\"node3\" class=\"node\">\n", 42 "<title>C</title>\n", 43 "<ellipse fill=\"none\" stroke=\"black\" cx=\"99\" cy=\"-18\" rx=\"27\" ry=\"18\"/>\n", 44 "<text text-anchor=\"middle\" x=\"99\" y=\"-14.3\" font-family=\"Times,serif\" font-size=\"14.00\">C</text>\n", 45 "</g>\n", 46 "<!-- A->C -->\n", 47 "<g id=\"edge1\" class=\"edge\">\n", 48 "<title>A->C</title>\n", 49 "<path fill=\"none\" stroke=\"black\" d=\"M71.35,-72.76C75.71,-64.28 81.15,-53.71 86.04,-44.2\"/>\n", 50 "<polygon fill=\"black\" stroke=\"black\" points=\"89.23,-45.64 90.7,-35.15 83.01,-42.44 89.23,-45.64\"/>\n", 51 "</g>\n", 52 "</g>\n", 53 "</svg>\n" 54 ], 55 "text/plain": [ 56 "<graphviz.graphs.Digraph at 0x7f4bcbd3e450>" 57 ] 58 }, 59 "execution_count": 9, 60 "metadata": {}, 61 "output_type": "execute_result" 62 } 63 ], 64 "source": [ 65 "from graphviz import Digraph\n", 66 "\n", 67 "dot = Digraph()\n", 68 "\n", 69 "dot.node('A')\n", 70 "dot.node('B')\n", 71 "dot.node('C')\n", 72 "dot.edge('A' , 'C')\n", 73 "dot.edge('A' , 'B')\n", 74 "\n", 75 "dot" 76 ] 77 } 78 ], 79 "metadata": { 80 "kernelspec": { 81 "display_name": ".venv", 82 "language": "python", 83 "name": "python3" 84 }, 85 "language_info": { 86 "codemirror_mode": { 87 "name": "ipython", 88 "version": 3 89 }, 90 "file_extension": ".py", 91 "mimetype": "text/x-python", 92 "name": "python", 93 "nbconvert_exporter": "python", 94 "pygments_lexer": "ipython3", 95 "version": "3.11.2" 96 } 97 }, 98 "nbformat": 4, 99 "nbformat_minor": 2 100 }