

.. _sphx_glr_users_explain_text:

.. redirect-from:: /tutorials/text

.. _tutorials-text:

Text
----

Matplotlib has extensive text support, including support for
mathematical expressions, TrueType support for raster and
vector outputs, newline separated text with arbitrary
rotations, and Unicode support. These tutorials cover
the basics of working with text in Matplotlib.

For even more information see the :ref:`examples page <text_labels_and_annotations>`.



.. raw:: html

    <div class="sphx-glr-thumbnails">

.. thumbnail-parent-div-open

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Introduction to plotting and working with text in Matplotlib.">

.. only:: html

  .. image:: /users/explain/text/images/thumb/sphx_glr_text_intro_thumb.png
    :alt:

  :ref:`sphx_glr_users_explain_text_text_intro.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Text in Matplotlib</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Controlling properties of text and its layout with Matplotlib.">

.. only:: html

  .. image:: /users/explain/text/images/thumb/sphx_glr_text_props_thumb.png
    :alt:

  :ref:`sphx_glr_users_explain_text_text_props.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Text properties and layout</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Annotations are graphical elements, often pieces of text, that explain, add context to, or othe...">

.. only:: html

  .. image:: /users/explain/text/images/thumb/sphx_glr_annotations_thumb.png
    :alt:

  :ref:`sphx_glr_users_explain_text_annotations.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Annotations</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Matplotlib needs fonts to work with its text engine, some of which are shipped alongside the in...">

.. only:: html

  .. image:: /users/explain/text/images/thumb/sphx_glr_fonts_thumb.png
    :alt:

  :ref:`sphx_glr_users_explain_text_fonts.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Fonts in Matplotlib</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Matplotlib implements a lightweight TeX expression parser and layout engine and Mathtext is the...">

.. only:: html

  .. image:: /users/explain/text/images/thumb/sphx_glr_mathtext_thumb.png
    :alt:

  :ref:`sphx_glr_users_explain_text_mathtext.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Writing mathematical expressions</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Using the pgf backend, Matplotlib can export figures as pgf drawing commands that can be proces...">

.. only:: html

  .. image:: /users/explain/text/images/thumb/sphx_glr_pgf_thumb.png
    :alt:

  :ref:`sphx_glr_users_explain_text_pgf.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Text rendering with XeLaTeX/LuaLaTeX via the pgf backend</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="Matplotlib can use LaTeX to render text.  This is activated by setting text.usetex : True in yo...">

.. only:: html

  .. image:: /users/explain/text/images/thumb/sphx_glr_usetex_thumb.png
    :alt:

  :ref:`sphx_glr_users_explain_text_usetex.py`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Text rendering with LaTeX</div>
    </div>


.. thumbnail-parent-div-close

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /users/explain/text/text_intro
   /users/explain/text/text_props
   /users/explain/text/annotations
   /users/explain/text/fonts
   /users/explain/text/mathtext
   /users/explain/text/pgf
   /users/explain/text/usetex

