gpt4 book ai didi

python - 设置轴限制时 matplotlib 中的图像尺寸太大

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

为什么使用以下代码片段(在 jupyter 笔记本中使用 pyplot):

plt.rcParams['figure.figsize'] = [10, 10]
plt.hist2d(np.random.randint(1e10, size=100000),
np.random.randint(1e10, size=100000))
plt.xlim(-1, 1)
plt.ylim(-1, 1)
plt.show()

给出了这个错误:

ValueError: Image size of -1757369422x-759354895 pixels is too large. It must be less than 2^16 in each direction.

无需设置 xlimylim 即可正常运行。如何有效地设置此类图上显示内容的界限?

最佳答案

这似乎是 matplotlib 中的一个错误,已被 reported

关于python - 设置轴限制时 matplotlib 中的图像尺寸太大,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52335555/

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