I think I found a bug when using Matplotlib's constrained layout and flexitext. In this case, flexitext makes the layout very inconsistent if the window is resized, and different from what is expected. Here's some example code:
import matplotlib.pyplot as plt
from flexitext import flexitext
fig, ax = plt.subplots(1, 2, figsize=(12, 6), layout="constrained")
text1 = "<size:42, name:Carlito>Some<color:#11557c, weight:bold> text</></>"
text2 = "<size:36, name:Lato, color:royalblue><weight:bold>Here</> too</>"
flexitext(0.5, 0.5, text1, ha="center", ax=ax[0])
flexitext(0.5, 0.5, text2, ha="center", ax=ax[1])
fig.set_facecolor("w")
# fig.savefig("example.png", dpi=300)
plt.show()
Here is a screenshot of the result:

After maximizing the window, and going back to its original size, the layout has changed:

Maximizing again, and going back to the original size:

Note that uncommenting fig.savefig("example.png", dpi=300) triggers a canvas draw and improves the layout for the given window size, but it doesn't seem to be what the layout would be without the flexitext.
Expected layout:

Layout after a canvas draw:

What do you think?
I think I found a bug when using Matplotlib's
constrainedlayout andflexitext. In this case,flexitextmakes the layout very inconsistent if the window is resized, and different from what is expected. Here's some example code:Here is a screenshot of the result:

After maximizing the window, and going back to its original size, the layout has changed:

Maximizing again, and going back to the original size:

Note that uncommenting
fig.savefig("example.png", dpi=300)triggers a canvas draw and improves the layout for the given window size, but it doesn't seem to be what the layout would be without theflexitext.Expected layout:

Layout after a canvas draw:

What do you think?