.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/style/plot_curved_waypoints.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_curved_waypoints.py: Curved waypoints ================ This example demonstrates the use of curved edge waypoints. For straight waypoints, the edge will pass through each waypoint. For curved waypoints, they are used as cubic Bezier points to interpolate smoothly between. .. GENERATED FROM PYTHON SOURCE LINES 10-41 .. code-block:: Python import matplotlib.pyplot as plt import numpy as np import iplotx as ipx g = { "edges": [ ("A", "B"), ], } layout = { "A": (0, 0), "B": (1, 2), } fig, axs = plt.subplots(1, 2, figsize=(8, 4)) for ax, curved in zip(axs, [False, True]): ipx.network( g, layout=layout, ax=ax, vertex_labels=True, edge_waypoints=[[[1, 1], [0, 1.5]]], edge_curved=curved, ) if not curved: ax.set_title("Straight waypoints") else: ax.set_title("Curved waypoints") fig.tight_layout() .. image-sg:: /gallery/style/images/sphx_glr_plot_curved_waypoints_001.png :alt: Straight waypoints, Curved waypoints :srcset: /gallery/style/images/sphx_glr_plot_curved_waypoints_001.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 42-44 .. tip:: The edge will actually pass through the midpoints between two consecutive waypoints. .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.065 seconds) .. _sphx_glr_download_gallery_style_plot_curved_waypoints.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_curved_waypoints.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_curved_waypoints.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_curved_waypoints.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_