gpt4 book ai didi

python - matplotlib 中的 figsize 没有改变图形大小?

转载 作者:太空狗 更新时间:2023-10-29 22:08:46 25 4
gpt4 key购买 nike

<分区>

如您所见,代码生成的条形图不那么清晰,我想让图形变大以便更好地查看值。这不行。什么是正确的方法?x 是数据框,x['user'] 是图中的 x 轴,x['number'] 是 y。

import matplotlib.pyplot as plt
%matplotlib inline
plt.bar(x['user'], x['number'], color="blue")
plt.figure(figsize=(20,10))

带有 plt.figure 的行不会改变初始尺寸。

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