serhii.net

In the middle of the desert you can say anything you want

28 Jun 2023

Saving plots matplotlib seaborn

When saving seaborn images there was weirdness going on, with borders either cutting labels or benig too big.

Solution:

# bad: cut corners
ax.figure.savefig("inat_pnet_lorenz.png")
# good: no cut corners and OK bounding box
ax.figure.savefig("inat_pnet_lorenz.png", bbox_inches="tight")
Nel mezzo del deserto posso dire tutto quello che voglio.