.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/plot_configuration.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_configuration.py: Global Configuration ==================== Set project-wide defaults with :data:`~memeplotlib.config` so every meme inherits the same look. .. GENERATED FROM PYTHON SOURCE LINES 10-15 Changing Defaults ------------------ Any attribute on ``config`` becomes the new default for all subsequent :func:`~memeplotlib.meme` and :class:`~memeplotlib.Meme` calls. .. GENERATED FROM PYTHON SOURCE LINES 15-25 .. code-block:: Python import memeplotlib as memes memes.config.font = "comic" memes.config.color = "yellow" memes.config.fontsize = 120 memes.config.style = "none" memes.meme("buzz", "custom defaults", "applied everywhere", show=False) .. image-sg:: /auto_examples/images/sphx_glr_plot_configuration_001.png :alt: plot configuration :srcset: /auto_examples/images/sphx_glr_plot_configuration_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none findfont: Font family ['Comic Sans MS'] not found. Falling back to DejaVu Sans. /home/runner/work/memeplotlib/memeplotlib/src/memeplotlib/_rendering.py:410: UserWarning: Font 'comic' not found. Using fallback font. Install 'comic' for best results. _draw_meme_text( findfont: Font family 'Comic Sans MS' not found. findfont: Font family 'Comic Sans MS' not found. findfont: Font family 'Comic Sans MS' not found. findfont: Font family 'Comic Sans MS' not found. (
, ) .. GENERATED FROM PYTHON SOURCE LINES 26-27 Reset to defaults for the rest of the examples. .. GENERATED FROM PYTHON SOURCE LINES 27-32 .. code-block:: Python memes.config.font = "impact" memes.config.color = "white" memes.config.fontsize = 72.0 memes.config.style = "upper" .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.350 seconds) .. _sphx_glr_download_auto_examples_plot_configuration.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_configuration.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_configuration.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_configuration.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_