我尝试使用Python matplotlib打印一个600 dpi的图形。但是Python绘制了8个图形中的2个,并输出错误:
OverflowError: Agg rendering complexity exceeded. Consider downsampling or decimating your data.
我正在绘制一个巨大的数据块(每列7500000个数据),所以我想要么这将是一些重载问题,要么我需要设置一个大的单元格块的限制。在
我试图寻找解决方案,以改变谷歌的细胞块限制,但没有结果。什么是好方法?在
代码为以下内容:-在
^{pr2}$
除了@Lennart认为不需要完整的分辨率之外,您还可以考虑一个类似于下面的图。在
如果使用原始数组的二维视图和
axis
关键字arg到x.min()
,x.max()
等,计算“分块”版本的最大/平均/最小值非常简单和高效即使使用了过滤,绘制它也比绘制整个数组快得多。在
(注:要想画出这么多点,你得把噪音调小一点。否则你会得到你提到的
OverflowError
。如果要比较绘制“完整”数据集,请将y += 0.3 * y.max() np.random...
行改为更像0.1
或完全删除它。)如果使用600dpi,则必须使绘图宽度为13米才能绘制数据,而不会造成数据损失。:-)
我建议将数据分成几百个甚至一千个样本,然后从中提取最大值。在
像这样:
然后,如果chunk_的大小为1000,就可以得到7500个点来绘制,在那里你可以很容易地看到数据中的冲击来自何处。(除非数据非常嘈杂,否则您必须将其平均,以查看是否存在阻塞。但这也很容易解决)。在
相关问题 更多 >
编程相关推荐