.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/misc/hyperlinks_sgskip.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. meta:: :keywords: codex .. 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_misc_hyperlinks_sgskip.py: ========== Hyperlinks ========== This example demonstrates how to set a hyperlinks on various kinds of elements. This currently only works with the SVG backend. .. GENERATED FROM PYTHON SOURCE LINES 11-18 .. code-block:: Python import matplotlib.pyplot as plt import numpy as np import matplotlib.cm as cm .. GENERATED FROM PYTHON SOURCE LINES 19-25 .. code-block:: Python fig = plt.figure() s = plt.scatter([1, 2, 3], [4, 5, 6]) s.set_urls(['https://www.bbc.com/news', 'https://www.google.com/', None]) fig.savefig('scatter.svg') .. GENERATED FROM PYTHON SOURCE LINES 26-40 .. code-block:: Python fig = plt.figure() delta = 0.025 x = y = np.arange(-3.0, 3.0, delta) X, Y = np.meshgrid(x, y) Z1 = np.exp(-X**2 - Y**2) Z2 = np.exp(-(X - 1)**2 - (Y - 1)**2) Z = (Z1 - Z2) * 2 im = plt.imshow(Z, interpolation='bilinear', cmap=cm.gray, origin='lower', extent=(-3, 3, -3, 3)) im.set_url('https://www.google.com/') fig.savefig('image.svg') .. _sphx_glr_download_gallery_misc_hyperlinks_sgskip.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: hyperlinks_sgskip.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: hyperlinks_sgskip.py ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_