.. note:: :class: sphx-glr-download-link-note Click :ref:`here ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_gallery_plot_layout.py: Different layouts ================= Grave supports different layouts by default. .. image:: /gallery/images/sphx_glr_plot_layout_001.png :class: sphx-glr-single-img .. code-block:: python import networkx as nx import matplotlib.pyplot as plt from grave import grave graph = nx.barbell_graph(10, 14) nx.set_node_attributes(graph, dict(graph.degree()), 'degree') fig, axes = plt.subplots(nrows=2, ncols=2) grave.plot_network(graph, ax=axes[0, 0], layout="spring") axes[0, 0].set_title("spring", fontweight="bold") grave.plot_network(graph, ax=axes[1, 0], layout="circular") axes[1, 0].set_title("circular", fontweight="bold") grave.plot_network(graph, ax=axes[0, 1], layout="random") axes[0, 1].set_title("random", fontweight="bold") grave.plot_network(graph, ax=axes[1, 1], layout="spectral") axes[1, 1].set_title("spectral", fontweight="bold") plt.show() **Total running time of the script:** ( 0 minutes 0.110 seconds) .. _sphx_glr_download_gallery_plot_layout.py: .. only :: html .. container:: sphx-glr-footer :class: sphx-glr-footer-example .. container:: sphx-glr-download :download:`Download Python source code: plot_layout.py ` .. container:: sphx-glr-download :download:`Download Jupyter notebook: plot_layout.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_