.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples/path_effects/test_glow.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_examples_path_effects_test_glow.py: ==================== Cyberpunk Example ==================== .. GENERATED FROM PYTHON SOURCE LINES 7-43 .. image-sg:: /examples/path_effects/images/sphx_glr_test_glow_001.png :alt: Cyberpunk :srcset: /examples/path_effects/images/sphx_glr_test_glow_001.png :class: sphx-glr-single-img .. code-block:: Python from mpl_visual_context.patheffects_image_box import AlphaGradient import numpy as np import matplotlib.pyplot as plt import mplcyberpunk from mpl_visual_context.pe_cyberfunk import GlowStroke from mpl_visual_context.patheffects import AlphaGradient # from mpl_visual_context.image_box import AlphaGradient #ImageClipEffect, ArtistBboxAlpha from matplotlib.patheffects import Normal plt.style.use("cyberpunk") fig, ax = plt.subplots(num=1, clear=True) y1 = [1, 3, 9, 5, 2, 1, 1] y2 = [4, 5, 5, 7, 10, 8, 6] (l1,) = ax.plot(y1, marker='o') (l2,) = ax.plot(y2, marker='o') ax.set_title("Cyberpunk", fontsize=30) p1 = ax.fill_between(x=np.arange(len(y1)), y1=y1, y2=0) p2 = ax.fill_between(x=np.arange(len(y1)), y1=y2, y2=0) from matplotlib.patheffects import Normal for l in [l1, l2]: l.set_path_effects([GlowStroke()]) pe = [AlphaGradient("0 ^ 0.3")] for p in [p1, p2]: p.set_path_effects(pe) plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.091 seconds) .. _sphx_glr_download_examples_path_effects_test_glow.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: test_glow.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: test_glow.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: test_glow.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_