.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "11_demos\python_packages\matplotlib\demo_qbstyles.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. 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_11_demos_python_packages_matplotlib_demo_qbstyles.py: Quantum Black Styles ==================== This `matplotlib `_ style `Quantum Black Styles `_ generates figures in dark style. In addition to `matplotlib `_, the style must be installed. .. code-block:: bat pip install qbstyles .. GENERATED FROM PYTHON SOURCE LINES 13-14 Import namespaces. .. GENERATED FROM PYTHON SOURCE LINES 14-19 .. code-block:: Python import numpy as np import matplotlib.pyplot as plt from qbstyles import mpl_style .. GENERATED FROM PYTHON SOURCE LINES 20-21 Generate demo x and y values. .. GENERATED FROM PYTHON SOURCE LINES 21-25 .. code-block:: Python x = np.linspace(0, 10, 20) y = np.sin(x) y2 = np.cos(x) .. GENERATED FROM PYTHON SOURCE LINES 26-27 Set dark style. .. GENERATED FROM PYTHON SOURCE LINES 27-29 .. code-block:: Python mpl_style(dark=True) .. GENERATED FROM PYTHON SOURCE LINES 30-31 Plot data. .. GENERATED FROM PYTHON SOURCE LINES 31-40 .. code-block:: Python plt.figure(figsize=(6, 6)) plt.plot(x, y, marker="o", label="Line 1") plt.plot(x, y2, marker="x", label="Line 2") plt.xlabel("X") plt.ylabel("Y") plt.legend() plt.grid() plt.show() .. image-sg:: /11_demos/python_packages/matplotlib/images/sphx_glr_demo_qbstyles_001.png :alt: demo qbstyles :srcset: /11_demos/python_packages/matplotlib/images/sphx_glr_demo_qbstyles_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.092 seconds) .. _sphx_glr_download_11_demos_python_packages_matplotlib_demo_qbstyles.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: demo_qbstyles.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: demo_qbstyles.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: demo_qbstyles.zip `