.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/network_science/plot_parallel_igraph_networkx.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_network_science_plot_parallel_igraph_networkx.py: igraph/networkx compatibility ============================= The same graph in igraph and networkx, plotted with iplotx. .. GENERATED FROM PYTHON SOURCE LINES 7-24 .. image-sg:: /gallery/network_science/images/sphx_glr_plot_parallel_igraph_networkx_001.png :alt: igraph, networkx :srcset: /gallery/network_science/images/sphx_glr_plot_parallel_igraph_networkx_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none [] | .. code-block:: Python import igraph as ig import networkx as nx import matplotlib.pyplot as plt import iplotx as ipx fig, axs = plt.subplots(1, 2, figsize=(6, 3)) axs[0].set_title("igraph") g1 = ig.Graph.Ring(5, directed=True) layout1 = g1.layout("circle") ipx.plot(g1, ax=axs[0], layout=layout1) axs[1].set_title("networkx") g2 = nx.cycle_graph(n=5, create_using=nx.DiGraph) layout2 = nx.layout.circular_layout(g2) ipx.plot(g2, ax=axs[1], layout=layout2) .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.056 seconds) .. _sphx_glr_download_gallery_network_science_plot_parallel_igraph_networkx.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_parallel_igraph_networkx.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_parallel_igraph_networkx.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_parallel_igraph_networkx.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_