首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >“MatplotlibDeprecationWarning”-在绘制直方图时发出警告

“MatplotlibDeprecationWarning”-在绘制直方图时发出警告
EN

Stack Overflow用户
提问于 2022-09-26 01:15:08
回答 2查看 6.5K关注 0票数 6

我试图使用matplotlib绘制直方图,但始终遇到以下错误:

MatplotlibDeprecationWarning: The resize_event function was deprecated in Matplotlib 3.6 and will be removed two minor releases later. Use callbacks.process('resize_event', ResizeEvent(...)) instead.

这是我的代码;关于如何清理逻辑表达式的反馈也是值得欢迎的。

代码语言:javascript
复制
lower_quartile = df['2020 Population'].quantile(0.25)
mid_quartile = df['2020 Population'].quantile(0.5)
upper_quartile = df['2020 Population'].quantile(0.75)

new_data = df.loc[df['2020 Population'] > lower_quartile]

final_2020_range = new_data.loc[df['2020 Population'] < upper_quartile]

check = final_2020_range['2020 Population']

plt.hist(check)
EN

回答 2

Stack Overflow用户

发布于 2022-10-28 03:27:59

似乎你可以在这里找到你的答案:https://github.com/matplotlib/matplotlib/issues/23921

简而言之:这是一个bug,将在3.6.1中进行更正。

票数 3
EN

Stack Overflow用户

发布于 2022-11-02 10:00:10

我也面临着同样的问题,我找到了一个解决办法:

代码语言:javascript
复制
    import matplotlib
    matplotlib.use('TkAgg')

错误仍然存在,但是现在你可以看到情节了。:D

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/73848820

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档