
.. DO NOT EDIT.
.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY.
.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE:
.. "gallery/text_labels_and_annotations/watermark_text.py"
.. LINE NUMBERS ARE GIVEN BELOW.

.. only:: html

    .. meta::
        :keywords: codex

    .. note::
        :class: sphx-glr-download-link-note

        :ref:`Go to the end <sphx_glr_download_gallery_text_labels_and_annotations_watermark_text.py>`
        to download the full example code.

.. rst-class:: sphx-glr-example-title

.. _sphx_glr_gallery_text_labels_and_annotations_watermark_text.py:


==============
Text watermark
==============

A watermark effect can be achieved by drawing a semi-transparent text.

.. GENERATED FROM PYTHON SOURCE LINES 8-25

.. code-block:: Python

    import matplotlib.pyplot as plt
    import numpy as np

    # Fixing random state for reproducibility
    np.random.seed(19680801)


    fig, ax = plt.subplots()
    ax.plot(np.random.rand(20), '-o', ms=20, lw=2, alpha=0.7, mfc='orange')
    ax.grid()

    ax.text(0.5, 0.5, 'created with matplotlib', transform=ax.transAxes,
            fontsize=40, color='gray', alpha=0.5,
            ha='center', va='center', rotation=30)

    plt.show()




.. image-sg:: /gallery/text_labels_and_annotations/images/sphx_glr_watermark_text_001.png
   :alt: watermark text
   :srcset: /gallery/text_labels_and_annotations/images/sphx_glr_watermark_text_001.png, /gallery/text_labels_and_annotations/images/sphx_glr_watermark_text_001_2_00x.png 2.00x
   :class: sphx-glr-single-img





.. GENERATED FROM PYTHON SOURCE LINES 26-32

.. admonition:: References

   The use of the following functions, methods, classes and modules is shown
   in this example:

   - `matplotlib.figure.Figure.text`


.. _sphx_glr_download_gallery_text_labels_and_annotations_watermark_text.py:

.. only:: html

  .. container:: sphx-glr-footer sphx-glr-footer-example

    .. container:: sphx-glr-download sphx-glr-download-jupyter

      :download:`Download Jupyter notebook: watermark_text.ipynb <watermark_text.ipynb>`

    .. container:: sphx-glr-download sphx-glr-download-python

      :download:`Download Python source code: watermark_text.py <watermark_text.py>`

    .. container:: sphx-glr-download sphx-glr-download-zip

      :download:`Download zipped: watermark_text.zip <watermark_text.zip>`


.. only:: html

 .. rst-class:: sphx-glr-signature

    `Gallery generated by Sphinx-Gallery <https://sphinx-gallery.github.io>`_
