.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "plot_types/basic/fill_between.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_plot_types_basic_fill_between.py: Fill Between ============ A shaded band between two curves using the :class:`FillBetween` layer. .. GENERATED FROM PYTHON SOURCE LINES 7-40 .. image-sg:: /plot_types/basic/images/sphx_glr_fill_between_001.png :alt: Fill Between :srcset: /plot_types/basic/images/sphx_glr_fill_between_001.png :class: sphx-glr-single-img .. code-block:: Python import numpy as np from emcpy.plots.plots import LinePlot, FillBetween from emcpy.plots.create_plots import CreatePlot, CreateFigure x = np.linspace(0, 10, 400) y = np.sin(x) band = 0.3 p = CreatePlot() layers = [] fb = FillBetween(x, y - band, y + band) fb.alpha = 0.25 fb.label = "±0.3 band" layers.append(fb) lp = LinePlot(x, y) lp.linewidth = 2 lp.label = "signal" layers.append(lp) p.plot_layers = layers p.add_title("Fill Between") p.add_xlabel("x") p.add_ylabel("value") p.add_grid() p.add_legend(loc="upper right", frameon=False) fig = CreateFigure(1, 1, figsize=(7.5, 4)) fig.plot_list = [p] fig.create_figure() fig.tight_layout() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.074 seconds) .. _sphx_glr_download_plot_types_basic_fill_between.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: fill_between.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: fill_between.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: fill_between.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_