.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples/path_effects/text_along_arc.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_text_along_arc.py: ==================== Simple text-along-arc demo ==================== .. GENERATED FROM PYTHON SOURCE LINES 7-38 .. image-sg:: /examples/path_effects/images/sphx_glr_text_along_arc_001.png :alt: text along arc :srcset: /examples/path_effects/images/sphx_glr_text_along_arc_001.png :class: sphx-glr-single-img .. code-block:: Python import matplotlib.pyplot as plt from mpl_visual_context.patheffects import Recenter from mpl_visual_context.patheffects_path import TextAlongArc fig, ax = plt.subplots(num=1, clear=True) ax.set_aspect(1) t = ax.text(0.5, 0.5, "Matplotlib", size=60, va="center", ha="center", rotation=0, bbox=dict(ec="r", fc="none")) t.set_path_effects([TextAlongArc(500, smooth_line=False)]) t.get_bbox_patch().set_path_effects([TextAlongArc(500, smooth_line=True, n_split=4)]) from matplotlib.patches import Circle cir = Circle((0.5, 0.5), 0.4, ec="k", fc="none") ax.add_patch(cir) t = ax.text(0.5, 0.9, "Matplotlib", size=10, va="bottom", ha="center", rotation=0) recenter = Recenter(ax, 0.5, 0.5) t.set_path_effects([recenter | TextAlongArc(None) | recenter.restore()]) t = ax.text(0.1, 0.5, "Matplotlib", size=10, va="bottom", ha="center", rotation=90, rotation_mode="anchor") t.set_path_effects([recenter | TextAlongArc(None) | recenter.restore()]) # ax.set_aspect(1) plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.052 seconds) .. _sphx_glr_download_examples_path_effects_text_along_arc.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: text_along_arc.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: text_along_arc.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: text_along_arc.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_