
.. DO NOT EDIT.
.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY.
.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE:
.. "gallery/ticks/fig_axes_customize_simple.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_ticks_fig_axes_customize_simple.py>`
        to download the full example code.

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

.. _sphx_glr_gallery_ticks_fig_axes_customize_simple.py:


=========================
Fig Axes Customize Simple
=========================

Customize the background, labels and ticks of a simple plot.

.. redirect-from:: /gallery/pyplots/fig_axes_customize_simple

.. GENERATED FROM PYTHON SOURCE LINES 10-13

.. code-block:: Python


    import matplotlib.pyplot as plt


.. GENERATED FROM PYTHON SOURCE LINES 14-15

`.pyplot.figure` creates a `matplotlib.figure.Figure` instance.

.. GENERATED FROM PYTHON SOURCE LINES 15-29

.. code-block:: Python


    fig = plt.figure()
    rect = fig.patch  # a rectangle instance
    rect.set_facecolor('lightgoldenrodyellow')

    ax1 = fig.add_axes([0.1, 0.3, 0.4, 0.4])
    rect = ax1.patch
    rect.set_facecolor('lightslategray')

    ax1.tick_params(axis='x', labelcolor='tab:red', labelrotation=45, labelsize=16)
    ax1.tick_params(axis='y', color='tab:green', size=25, width=3)

    plt.show()


.. GENERATED FROM PYTHON SOURCE LINES 30-45

.. admonition:: References

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

   - `matplotlib.axis.Axis.get_ticklabels`
   - `matplotlib.axis.Axis.get_ticklines`
   - `matplotlib.text.Text.set_rotation`
   - `matplotlib.text.Text.set_fontsize`
   - `matplotlib.text.Text.set_color`
   - `matplotlib.lines.Line2D`
   - `matplotlib.lines.Line2D.set_markeredgecolor`
   - `matplotlib.lines.Line2D.set_markersize`
   - `matplotlib.lines.Line2D.set_markeredgewidth`
   - `matplotlib.patches.Patch.set_facecolor`


.. _sphx_glr_download_gallery_ticks_fig_axes_customize_simple.py:

.. only:: html

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

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

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

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

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

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

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


.. only:: html

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

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