.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples/example.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_examples_example.py: --------------- annotate_bubble --------------- .. GENERATED FROM PYTHON SOURCE LINES 7-33 .. image-sg:: /examples/images/sphx_glr_example_001.png :alt: example :srcset: /examples/images/sphx_glr_example_001.png :class: sphx-glr-single-img .. code-block:: Python import numpy as np import matplotlib.pyplot as plt from matplotlib.patches import Ellipse from mpl_speech_bubble import annotate_bubble fig, ax = plt.subplots(num=1, clear=True) arr = np.arange(100).reshape((10, 10)) ax.imshow(arr, interpolation="bilinear") el = Ellipse((4, 4), 0.5, 0.5, color="y") ax.add_patch(el) ann = annotate_bubble(ax, 'speech\nbubble', xy=(4, 4), xycoords='data', loc="up", size=20, color="w", ha="left", bbox=dict(boxstyle="round", fc="none", ec="w"), arrowprops=dict(arrowstyle="wedge,tail_width=1.5", patchA=None, patchB=el, connectionstyle="arc3,rad=-0.1")) plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.401 seconds) .. _sphx_glr_download_examples_example.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: example.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: example.py ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_