我试图使用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.
这是我的代码;关于如何清理逻辑表达式的反馈也是值得欢迎的。
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)发布于 2022-10-28 03:27:59
似乎你可以在这里找到你的答案:https://github.com/matplotlib/matplotlib/issues/23921
简而言之:这是一个bug,将在3.6.1中进行更正。
发布于 2022-11-02 10:00:10
我也面临着同样的问题,我找到了一个解决办法:
import matplotlib
matplotlib.use('TkAgg')错误仍然存在,但是现在你可以看到情节了。:D
https://stackoverflow.com/questions/73848820
复制相似问题