.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/style/plot_edge_geometries.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_geometries.py: Edge geometries =============== This example shows how to use edge geometries and tension to achieve different visualisation styles. .. GENERATED FROM PYTHON SOURCE LINES 7-62 .. image-sg:: /gallery/style/images/sphx_glr_plot_edge_geometries_001.png :alt: Tension 1.0, Tension 5.0, Tension 10.0, Tension 0.2, Tension 1.0, Tension 2.0 :srcset: /gallery/style/images/sphx_glr_plot_edge_geometries_001.png :class: sphx-glr-single-img .. code-block:: Python import igraph as ig import matplotlib.pyplot as plt import iplotx as ipx g = ig.Graph.Full(2) layout = [[0, 0], [1, 0]] fig, axs = plt.subplots(3, 3, figsize=(6, 6), sharex=True, sharey=True) tensions = [ [1, 5, 10], [0.2, 1, 2], ] for edge_arc, axrow, tensionrow in zip([False, True], axs, tensions): kwargs = {} if not edge_arc: kwargs["edge_curved"] = True for tension, ax in zip(tensionrow, axrow): ipx.plot( g, layout=layout, ax=ax, edge_arc=edge_arc, edge_tension=tension, title=f"Tension {tension:.1f}", node_size=10, **kwargs, ) axs[0, 0].set_ylabel("Bezier", fontsize=12) axs[1, 0].set_ylabel("Arc", fontsize=12) ipx.plot( g, layout, ax=axs[2, 0], node_size=10, ) axs[2, 0].set_ylabel("Straight", fontsize=12) ipx.plot( g, layout, ax=axs[2, 1], node_size=10, edge_waypoints=[[0.5, -0.15]], ) ipx.plot( g, layout, ax=axs[2, 2], node_size=10, edge_waypoints=[[[0.25, -0.15], [0.75, -0.15]]], ) axs[2, 1].set_ylabel("Waypoints", fontsize=12) fig.tight_layout() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.214 seconds) .. _sphx_glr_download_gallery_style_plot_edge_geometries.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_geometries.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_edge_geometries.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_edge_geometries.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_