Global Configuration#

Set project-wide defaults via the config mapping so every meme inherits the same look. The mapping behaves like matplotlib.rcParams – treat it as a validated key-value store.

Changing Defaults#

config is a MemeplotlibConfig mapping. Set keys to override defaults for all subsequent meme() and Meme calls.

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")
plot configuration
(<Figure size 1200x912.548 with 1 Axes>, <Axes: >)

Reset back to the original defaults.

memes.config.reset()

Scoped overrides with rc_context#

Use rc_context() to apply config changes only inside a with block, mirroring matplotlib.rc_context().

with memes.rc_context({"color": "yellow", "font": "comic"}):
    memes.meme("buzz", "yellow comic", "for this block only")

# Outside the block, defaults are unchanged.
assert memes.config["color"] == "white"
plot configuration

Total running time of the script: (0 minutes 0.948 seconds)

Gallery generated by Sphinx-Gallery