.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/style/plot_multistyle.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_multistyle.py: Style library ============= This example shows the same network plotted with a variery of styles from the `iplotx` style library. .. tip:: You can further modify any of these styles with a custom dictionary (see :doc:`plot_style`). .. GENERATED FROM PYTHON SOURCE LINES 11-44 .. code-block:: Python import igraph as ig import matplotlib.pyplot as plt import iplotx as ipx styles = [ "default", "hollow", "tree", "greyscale", "rededge", "rednode", "networkx", "igraph", "eerie", "unicorn", ] g = ig.Graph.Ring(9, directed=True) layout = g.layout("circle") fig, axs = plt.subplots(5, 2, figsize=(7.5, 20)) for style, ax in zip(styles, axs.ravel()): ipx.plot( g, ax=ax, layout=layout, style=style, vertex_labels=style in ("default", "hollow", "unicorn", "networkx", "igraph"), title=style, margins=0.1 if style == "unicorn" else 0, ) .. image-sg:: /gallery/style/images/sphx_glr_plot_multistyle_001.png :alt: default, hollow, tree, greyscale, rededge, rednode, networkx, igraph, eerie, unicorn :srcset: /gallery/style/images/sphx_glr_plot_multistyle_001.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 45-46 For completeness, below the same plot but for the undirected ring graph: .. GENERATED FROM PYTHON SOURCE LINES 46-60 .. code-block:: Python g = ig.Graph.Ring(9, directed=False) fig, axs = plt.subplots(5, 2, figsize=(7.5, 20)) for style, ax in zip(styles, axs.ravel()): ipx.plot( g, ax=ax, layout="circle", style=style, vertex_labels=style in ("default", "hollow", "unicorn", "networkx", "igraph"), title=style, margins=0.1 if style == "unicorn" else 0, ) .. image-sg:: /gallery/style/images/sphx_glr_plot_multistyle_002.png :alt: default, hollow, tree, greyscale, rededge, rednode, networkx, igraph, eerie, unicorn :srcset: /gallery/style/images/sphx_glr_plot_multistyle_002.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.666 seconds) .. _sphx_glr_download_gallery_style_plot_multistyle.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_multistyle.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_multistyle.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_multistyle.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_