Flexitext: Draw text with multiple formats

Hi all,

I’ve just released Flexitext, a library that makes it easier to draw text with multiple formats (colors, fonts, styles, sizes, etc.). This library tries to bring a little of the R library ggtext into Matplotlib.

Quick example:

import matplotlib.pyplot as plt
from flexitext import flexitext

fig, ax = plt.subplots(figsize=(9, 6))

text = (
    "<size:48, name:Calibri>Hi <color:#11557c, weight:bold>matplotlib</>!\n</>"
    + "<size:36, name:Lato, color:royalblue><weight:bold>Thanks</> for having me :)</>"
)

flexitext(0.5, 0.5, text, ha="center", ma="center")

GitHub repository: GitHub - tomicapretto/flexitext: Flexitext: Draw styled text in Matplotlib

Feel free to reach out if you want to say something about the project or you’d like to share any questions :smiley:

3 Likes