.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/plot_memify.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_auto_examples_plot_memify.py: Memify Existing Plots ===================== Overlay meme-style text on any matplotlib figure using :func:`~memeplotlib.memify`. .. GENERATED FROM PYTHON SOURCE LINES 10-14 Basic Memify ------------- Turn an ordinary matplotlib plot into a meme by adding bold, outlined text. .. GENERATED FROM PYTHON SOURCE LINES 14-23 .. code-block:: Python import matplotlib.pyplot as plt import memeplotlib as memes fig, ax = plt.subplots() ax.plot([1, 2, 3], [1, 4, 9]) ax.set_title("Quadratic growth") memes.memify(fig, "stonks") .. image-sg:: /auto_examples/images/sphx_glr_plot_memify_001.png :alt: Quadratic growth :srcset: /auto_examples/images/sphx_glr_plot_memify_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none
.. GENERATED FROM PYTHON SOURCE LINES 24-28 Bottom-Only Text ----------------- Use the ``position`` parameter to place text only at the bottom of the figure. .. GENERATED FROM PYTHON SOURCE LINES 28-32 .. code-block:: Python fig, ax = plt.subplots() ax.bar(["A", "B", "C"], [3, 7, 5]) memes.memify(fig, "not stonks", position="bottom") .. image-sg:: /auto_examples/images/sphx_glr_plot_memify_002.png :alt: plot memify :srcset: /auto_examples/images/sphx_glr_plot_memify_002.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none
.. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.128 seconds) .. _sphx_glr_download_auto_examples_plot_memify.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_memify.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_memify.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_memify.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_