.. 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_fill_features.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note Click :ref:`here ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_11_demos_python_packages_matplotlib_demo_fill_features.py: Fill features ================= Demo of the fill function with a few features. In addition to the basic fill plot, this demo shows a few optional features: * Multiple curves with a single command. * Setting the fill color. * Setting the opacity (alpha value). .. GENERATED FROM PYTHON SOURCE LINES 12-21 .. image-sg:: /11_demos/python_packages/matplotlib/images/sphx_glr_demo_fill_features_001.png :alt: demo fill features :srcset: /11_demos/python_packages/matplotlib/images/sphx_glr_demo_fill_features_001.png :class: sphx-glr-single-img .. code-block:: default import numpy as np import matplotlib.pyplot as plt plt.figure() x = np.linspace(0, 2 * np.pi, 100) y1 = np.sin(x) y2 = np.sin(3 * x) plt.fill(x, y1, "b", x, y2, "r", alpha=0.3) plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 0.102 seconds) .. _sphx_glr_download_11_demos_python_packages_matplotlib_demo_fill_features.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: demo_fill_features.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: demo_fill_features.ipynb `