.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/style_sheets/dark_background.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. meta:: :keywords: codex .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_gallery_style_sheets_dark_background.py: =========================== Dark background style sheet =========================== This example demonstrates the "dark_background" style, which uses white for elements that are typically black (text, borders, etc). Note that not all plot elements default to colors defined by an rc parameter. .. GENERATED FROM PYTHON SOURCE LINES 11-29 .. image-sg:: /gallery/style_sheets/images/sphx_glr_dark_background_001.png :alt: 'dark_background' style sheet :srcset: /gallery/style_sheets/images/sphx_glr_dark_background_001.png, /gallery/style_sheets/images/sphx_glr_dark_background_001_2_00x.png 2.00x :class: sphx-glr-single-img .. code-block:: Python import matplotlib.pyplot as plt import numpy as np plt.style.use('dark_background') fig, ax = plt.subplots() L = 6 x = np.linspace(0, L) ncolors = len(plt.rcParams['axes.prop_cycle']) shift = np.linspace(0, L, ncolors, endpoint=False) for s in shift: ax.plot(x, np.sin(x + s), 'o-') ax.set_xlabel('x-axis') ax.set_ylabel('y-axis') ax.set_title("'dark_background' style sheet") plt.show() .. _sphx_glr_download_gallery_style_sheets_dark_background.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: dark_background.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: dark_background.py ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_