Calling tight_layout()
in matplotlib can lead to: RunTimeError: "CGContextRef is NULL"
. I have suffered from this error myself with several backends (including Agg
) in MacOSX and Linux.
If I want to achieve the same, or hopefully close enough, effect, without running into these errors, what are my options?
While not the same problem, I worked around issues I was having with tight_layout()
by adding this to the start of my script instead.
matplotlib.rcParams.update({'figure.autolayout': True})
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With