.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/style/plot_edge_multicolor.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_style_plot_edge_multicolor.py: Multicolor edges ================ Sometimes the need arises to color edges with multiple colors at the same time. That's what multigraphs are for. This example shows the concept in action. .. GENERATED FROM PYTHON SOURCE LINES 9-30 .. image-sg:: /gallery/style/images/sphx_glr_plot_edge_multicolor_001.png :alt: plot edge multicolor :srcset: /gallery/style/images/sphx_glr_plot_edge_multicolor_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none [] | .. code-block:: Python import networkx as nx import matplotlib.pyplot as plt import iplotx as ipx g = nx.MultiGraph() g.add_edges_from([(0, 1), (1, 2), (0, 2), (0, 1)]) layout = [(0, 0), (1, 0), (0.5, 1)] ipx.network( g, layout, edge_color=["black", "gold", "tomato", "tomato"], edge_paralleloffset=8, edge_linewidth=4, vertex_size=40, vertex_facecolor="none", vertex_edgecolor="black", vertex_linewidth=4, ) .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.032 seconds) .. _sphx_glr_download_gallery_style_plot_edge_multicolor.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_edge_multicolor.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_edge_multicolor.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_edge_multicolor.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_