I am running a django app that includes matplotlib and allows the user to specify the axes of the graph. This can result in \'Overflow Error: Agg complexity exceeded
I find here http://www.mail-archive.com/matplotlib-users@lists.sourceforge.net/msg11809.html , it gives an interesting answer that may help
try replacing :
import matplotlib.pyplot as plt fig = plt.figure()
with
from matplotlib import figure fig = figure.Figure()