.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/style/plot_arrows.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_arrows.py: Arrowheads ========== This example showcases various types of arrowheads for connected graphs. .. GENERATED FROM PYTHON SOURCE LINES 7-35 .. image-sg:: /gallery/style/images/sphx_glr_plot_arrows_001.png :alt: Arrow markers :srcset: /gallery/style/images/sphx_glr_plot_arrows_001.png :class: sphx-glr-single-img .. code-block:: Python import networkx as nx import matplotlib.pyplot as plt import iplotx as ipx arrow_markers = ["|>", "|/", "|\\", ">", "<", ">>", ")>", ")", "(", "]", "[", "|", "x", "s", "d", "p", "q"] n = len(arrow_markers) G = nx.DiGraph() G.add_edges_from([(f"l{i}", f"r{i}") for i in range(n)]) layout = {f"l{i}": (0, -i) for i in range(n)} layout.update({f"r{i}": (1, -i) for i in range(n)}) fig, ax = plt.subplots(figsize=(3, 8.5)) ipx.network( G, layout=layout, ax=ax, vertex_size=12, edge_arrow_marker=arrow_markers, edge_arrow_height="width", edge_shrink=8, edge_color="steelblue", title="Arrow markers", ) ax.set_yticks(list(range(-n + 1, 1))[::-1]) ax.set_yticklabels(arrow_markers) ax.yaxis.set_tick_params(length=0) .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.077 seconds) .. _sphx_glr_download_gallery_style_plot_arrows.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_arrows.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_arrows.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_arrows.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_