.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/basic/plot_simple_path.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_gallery_basic_plot_simple_path.py: Simple path =========== A minimal example of using `iplotx` together with `networkx`. .. GENERATED FROM PYTHON SOURCE LINES 7-15 .. code-block:: Python import networkx as nx import iplotx as ipx G = nx.path_graph(8) pos = nx.spring_layout(G, seed=47) # Seed layout for reproducibility ipx.network(G, layout=pos) .. image-sg:: /gallery/basic/images/sphx_glr_plot_simple_path_001.png :alt: plot simple path :srcset: /gallery/basic/images/sphx_glr_plot_simple_path_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none [] .. GENERATED FROM PYTHON SOURCE LINES 16-17 We can change the color of the vertices and edges with a touch of style: .. GENERATED FROM PYTHON SOURCE LINES 17-33 .. code-block:: Python ipx.network( G, layout=pos, style={ "vertex": { "facecolor": "lightblue", "edgecolor": "navy", "linewidth": 2.5, }, "edge": { "color": "navy", "linewidth": 2.5, }, }, ) .. image-sg:: /gallery/basic/images/sphx_glr_plot_simple_path_002.png :alt: plot simple path :srcset: /gallery/basic/images/sphx_glr_plot_simple_path_002.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none [] .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.070 seconds) .. _sphx_glr_download_gallery_basic_plot_simple_path.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_simple_path.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_simple_path.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_simple_path.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_