

.. _sphx_glr_gallery_style_sheets_fivethirtyeight.py:


===========================
FiveThirtyEight style sheet
===========================

This shows an example of the "fivethirtyeight" styling, which
tries to replicate the styles from FiveThirtyEight.com.




.. image:: /gallery/style_sheets/images/sphx_glr_fivethirtyeight_001.png
    :align: center





.. code-block:: python


    from matplotlib import pyplot as plt
    import numpy as np


    plt.style.use('fivethirtyeight')

    x = np.linspace(0, 10)

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

    fig, ax = plt.subplots()

    ax.plot(x, np.sin(x) + x + np.random.randn(50))
    ax.plot(x, np.sin(x) + 0.5 * x + np.random.randn(50))
    ax.plot(x, np.sin(x) + 2 * x + np.random.randn(50))
    ax.plot(x, np.sin(x) - 0.5 * x + np.random.randn(50))
    ax.plot(x, np.sin(x) - 2 * x + np.random.randn(50))
    ax.plot(x, np.sin(x) + np.random.randn(50))
    ax.set_title("'fivethirtyeight' style sheet")

    plt.show()

**Total running time of the script:** ( 0 minutes  0.029 seconds)



.. container:: sphx-glr-footer


  .. container:: sphx-glr-download

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



  .. container:: sphx-glr-download

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

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

    `Generated by Sphinx-Gallery <https://sphinx-gallery.readthedocs.io>`_
