gpt4 book ai didi

python - matplotlib - figsize 的段错误

转载 作者:太空宇宙 更新时间:2023-11-04 03:12:47 26 4
gpt4 key购买 nike

我不明白为什么要取消注释以下代码的第 3 行

from matplotlib import pyplot

pyplot.clf()
#pyplot.figure(figsize=(400, 200))
pyplot.plot(range(0,len(x)),x,label="x")
pyplot.legend(loc='best', fancybox=True, shadow=True)
pyplot.savefig("/home/user/ooo.png", dpi=600)

我收到段错误(核心已转储)错误。有谁知道如何解决这个问题?

最佳答案

400 英寸 x 200 英寸太大,因此您可能需要减小图形尺寸。

如果您需要缩放图像,我建议将其保存为矢量格式(参见 matplotlib: generating vector plot)。

关于python - matplotlib - figsize 的段错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37479304/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com