mplfinance icon indicating copy to clipboard operation
mplfinance copied to clipboard

mplfinance savefig MemoryError

Open lyl1836 opened this issue 3 years ago • 1 comments

Hi, Happy new year!

MplFinance very nice! It brings great convenience to my work! Thank you for your hard work!

However, when savfig several times, a memory error occurs, The current test is an error after savfig 9 pictures in succession,as shown in the figure below:

p1

Please give guidance on how to deal with this problem!

lyl1836 avatar Jan 17 '22 02:01 lyl1836

If you are saving many figures, without exiting your program, you must use matplotlib Agg backend. Near the very beginning of your code, do the following:

import matplotlib
matplotlib.use("Agg")

DanielGoldfarb avatar Jan 17 '22 02:01 DanielGoldfarb