I am trying to print a graph with a resolution of 600 dpi using Python matplotlib. However, Python built 2 out of 8 graphs and threw an error:
OverflowError: Agg rendering complexity exceeded. Consider downsampling or decimating your data.
I draw a huge chunk of data (7,500,000 data per column), so I assume this will be some kind of overload problem or I need to set a large cell_block_limit element.
I tried to find solutions to change cell_block_limit on Google, but to no avail. What would be a good approach?
The code is as follows: -
import matplotlib.pyplot as plt from matplotlib.ticker import MultipleLocator, FormatStrFormatter majorLocator = MultipleLocator(200) majorFormatter = FormatStrFormatter('%d') minorLocator = MultipleLocator(20) fig = plt.figure() ax = fig.add_subplot(111) ax.xaxis.set_major_locator(majorLocator) ax.xaxis.set_major_formatter(majorFormatter) ax.xaxis.set_minor_locator(minorLocator) ax.xaxis.set_ticks_position('bottom') ax.xaxis.grid(True,which='minor') ax.yaxis.grid(True) plt.plot(timemat,fildata) plt.xlabel(plotxlabel,fontsize=14) plt.ylabel(plotylabel,fontsize=14) plt.title(plottitle,fontsize=16) fig.savefig(plotsavetitle,dpi=600)
Harry MacDowel
source share