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

.. only:: html

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

        Click :ref:`here <sphx_glr_download_gallery_userdemo_pgf_texsystem.py>`
        to download the full example code

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

.. _sphx_glr_gallery_userdemo_pgf_texsystem.py:


=============
Pgf Texsystem
=============

.. GENERATED FROM PYTHON SOURCE LINES 7-28



.. image:: /gallery/userdemo/images/sphx_glr_pgf_texsystem_001.png
    :alt: pgf texsystem
    :class: sphx-glr-single-img


.. rst-class:: sphx-glr-script-out

 Out:

 .. code-block:: none

    /build/matplotlib-eAPYn3/matplotlib-3.3.4/examples/userdemo/pgf_texsystem.py:24: MatplotlibDeprecationWarning: Passing the pad parameter of tight_layout() positionally is deprecated since Matplotlib 3.3; the parameter will become keyword-only two minor releases later.
      plt.tight_layout(.5)






|

.. code-block:: default


    import matplotlib.pyplot as plt
    plt.rcParams.update({
        "pgf.texsystem": "pdflatex",
        "pgf.preamble": "\n".join([
             r"\usepackage[utf8x]{inputenc}",
             r"\usepackage[T1]{fontenc}",
             r"\usepackage{cmbright}",
        ]),
    })

    plt.figure(figsize=(4.5, 2.5))
    plt.plot(range(5))
    plt.text(0.5, 3., "serif", family="serif")
    plt.text(0.5, 2., "monospace", family="monospace")
    plt.text(2.5, 2., "sans-serif", family="sans-serif")
    plt.xlabel(r"µ is not $\mu$")
    plt.tight_layout(.5)

    plt.savefig("pgf_texsystem.pdf")
    plt.savefig("pgf_texsystem.png")


.. _sphx_glr_download_gallery_userdemo_pgf_texsystem.py:


.. only :: html

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



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

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



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

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


.. only:: html

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

    Keywords: matplotlib code example, codex, python plot, pyplot
    `Gallery generated by Sphinx-Gallery
    <https://sphinx-gallery.readthedocs.io>`_
