.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples/demo_engraved.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_demo_engraved.py: ==================== Simple engraved example ==================== .. GENERATED FROM PYTHON SOURCE LINES 6-32 .. image-sg:: /examples/images/sphx_glr_demo_engraved_001.png :alt: demo engraved :srcset: /examples/images/sphx_glr_demo_engraved_001.png :class: sphx-glr-single-img .. code-block:: Python import numpy as np import matplotlib import matplotlib.pyplot as plt from matplotlib.colors import LightSource from mpl_poormans_3d import Poormans3d, Poormans3dFace from mpl_visual_context.patheffects import Offset, Affine, StrokeColor, StrokeOnly, GCModify import mpl_visual_context.patheffects as pe fig, ax = plt.subplots(num=1, clear=True) t = ax.text(0.5, 0.65, "a", ha="center", va="center", size=500, color='C0') ls = LightSource(azdeg=0) ls2 = LightSource(azdeg=180+35) kw = dict(fraction=0.6) pe3d = Poormans3d(ls, (0, -15), direction=1, **kw) pe3d_face = Poormans3dFace(ls2, (0, -15), **kw) pe_affine = pe.Affine().scale(1, 0.8) t.set_path_effects([pe_affine | pe.ClipPathSelf() | pe3d_face, pe_affine | pe.ClipPathSelf() | pe3d, pe_affine | StrokeColor("w") | GCModify(linewidth=1) | StrokeOnly() ]) plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.485 seconds) .. _sphx_glr_download_examples_demo_engraved.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: demo_engraved.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: demo_engraved.py ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_