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

.. only:: html

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

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

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

.. _sphx_glr_gallery_pyplots_fig_axes_customize_simple.py:


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

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

.. GENERATED FROM PYTHON SOURCE LINES 8-11

.. code-block:: default


    import matplotlib.pyplot as plt








.. GENERATED FROM PYTHON SOURCE LINES 12-13

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

.. GENERATED FROM PYTHON SOURCE LINES 13-37

.. code-block:: default


    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')


    for label in ax1.xaxis.get_ticklabels():
        # label is a Text instance
        label.set_color('tab:red')
        label.set_rotation(45)
        label.set_fontsize(16)

    for line in ax1.yaxis.get_ticklines():
        # line is a Line2D instance
        line.set_color('tab:green')
        line.set_markersize(25)
        line.set_markeredgewidth(3)

    plt.show()




.. image:: /gallery/pyplots/images/sphx_glr_fig_axes_customize_simple_001.png
    :alt: fig axes customize simple
    :class: sphx-glr-single-img





.. GENERATED FROM PYTHON SOURCE LINES 38-45

------------

References
""""""""""

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

.. GENERATED FROM PYTHON SOURCE LINES 46-58

.. code-block:: default


    import matplotlib
    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_color
    matplotlib.lines.Line2D.set_markersize
    matplotlib.lines.Line2D.set_markeredgewidth
    matplotlib.patches.Patch.set_facecolor




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

 Out:

 .. code-block:: none


    <function Patch.set_facecolor at 0x7f73bedaa1f0>




.. _sphx_glr_download_gallery_pyplots_fig_axes_customize_simple.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: fig_axes_customize_simple.py <fig_axes_customize_simple.py>`



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

     :download:`Download Jupyter notebook: fig_axes_customize_simple.ipynb <fig_axes_customize_simple.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>`_
