.. _sphx_glr_gallery_plot_layout.py: Different layouts ================= GraVE supports different layouts by default. .. image:: /gallery/images/sphx_glr_plot_layout_001.png :align: center .. 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.212 seconds) .. only :: html .. container:: sphx-glr-footer .. 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 `_