.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples/text_outline.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_text_outline.py: ==================== Text Outline ==================== .. GENERATED FROM PYTHON SOURCE LINES 7-30 .. image-sg:: /examples/images/sphx_glr_text_outline_001.png :alt: text outline :srcset: /examples/images/sphx_glr_text_outline_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none /home/docs/checkouts/readthedocs.org/user_builds/mpl-skia-pathops/envs/latest/lib/python3.10/site-packages/mpl_visual_context/bezier_helper.py:7: UserWarning: bezier module not fount. Using bezier-lite. warnings.warn("bezier module not fount. Using bezier-lite.") | .. code-block:: Python import matplotlib.pyplot as plt from matplotlib.patches import PathPatch from matplotlib.text import TextPath from mpl_skia_pathops import SkiaPath fig, ax = plt.subplots(num=1, clear=True) ax.set_aspect(1) p = TextPath((0, 0), "MA", size=20) sp = SkiaPath.from_mpl(p) sp2 = sp.stroke(1.5, linejoin="round") - sp pp2 = PathPatch(sp2.to_mpl(), fc="w", ec="r") ax.add_patch(pp2) ax.set(xlim=(-5, 40), ylim=(-5, 20)) ax.patch.set_fc("gold") plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.285 seconds) .. _sphx_glr_download_examples_text_outline.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: text_outline.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: text_outline.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: text_outline.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_