.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/03_node_link/plot_12_primal_dual.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 or to run this example in your browser via Binder. .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_03_node_link_plot_12_primal_dual.py: Linked primal and dual views ============================ Reading a hypergraph together with its dual helps to switch between the two roles of the elements: in the production example an entity is a vertex of several tasks, and in the dual it becomes the hyperedge of those tasks. In the linked views (after Qu et al. 2022) the color of a hyperedge in one view is the color of the corresponding vertex in the other. .. GENERATED FROM PYTHON SOURCE LINES 13-24 .. image-sg:: /auto_examples/03_node_link/images/sphx_glr_plot_12_primal_dual_001.png :alt: primal, dual :srcset: /auto_examples/03_node_link/images/sphx_glr_plot_12_primal_dual_001.png :class: sphx-glr-single-img .. code-block:: Python import matplotlib.pyplot as plt import hatvis as hv from hatvis.plotting import draw_primal_dual H = hv.datasets.load_manufacturing_cps() # [snippet:pd] axes = draw_primal_dual(H, layout="similarity", style="smooth", labels=True, pad=0.025) # [/snippet:pd] axes[0].figure.set_size_inches(14, 6) plt.tight_layout() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.255 seconds) .. _sphx_glr_download_auto_examples_03_node_link_plot_12_primal_dual.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: binder-badge .. image:: images/binder_badge_logo.svg :target: https://mybinder.org/v2/gh/ComplexSystemsIntelligence/hatvis/main?urlpath=lab/tree/notebooks/auto_examples/03_node_link/plot_12_primal_dual.ipynb :alt: Launch binder :width: 150 px .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_12_primal_dual.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_12_primal_dual.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_12_primal_dual.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_