.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples/path_effects/demo_pe_affine.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_demo_pe_affine.py: ==================== Affine demo ==================== .. GENERATED FROM PYTHON SOURCE LINES 7-33 .. image-sg:: /examples/path_effects/images/sphx_glr_demo_pe_affine_001.png :alt: demo pe affine :srcset: /examples/path_effects/images/sphx_glr_demo_pe_affine_001.png :class: sphx-glr-single-img .. code-block:: Python import matplotlib.pyplot as plt from matplotlib.patheffects import Normal from mpl_visual_context.patheffects import FillColor from mpl_visual_context.patheffects_transform import Affine from mpl_visual_context.patheffects import (AlphaGradient, ImageEffect, StrokeColorFromFillColor, FillColor, GCModify, Glow) from mpl_visual_context.image_effect import GaussianBlur, Pad, Fill fig, ax = plt.subplots(num=1, clear=True) t = ax.text(0.5, 0.5, "Matplotlib", va="center", ha="center", size=50, rotation=0, color="C1") shadow = (Affine().scale(1, 0.5).skew_deg(45, 0).translate(5, 5) | AlphaGradient("0.6 ^ 0.3")) blur = ImageEffect(Pad(4)|Fill("k")|GaussianBlur(4)) t.set_path_effects([shadow | blur, StrokeColorFromFillColor() | GCModify(linewidth=2) | Glow(), StrokeColorFromFillColor() | GCModify(linewidth=1) | FillColor("w"), ]) plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.083 seconds) .. _sphx_glr_download_examples_path_effects_demo_pe_affine.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: demo_pe_affine.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: demo_pe_affine.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: demo_pe_affine.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_