Python Matplotlib弃用警告:is_first_col函数在Matplotlib 3.4中已弃用,将在两个次要版本后删除
当我运行下面的代码用这个数据集生成子图时Python Matplotlib弃用警告:is_first_col函数在Matplotlib 3.4中已弃用,将在两个次要版本后删除,python,pandas,matplotlib,Python,Pandas,Matplotlib,当我运行下面的代码用这个数据集生成子图时 data1=pd_read(file.csv) p cv V dV Dp Radius DVr lnr Dvlnr 0 1.062790 0.000000 0.000000 0.000000 1.062790 100.396127 0.000000 4.609124 0.000000 1
data1=pd_read(file.csv)
p cv V dV Dp Radius DVr lnr Dvlnr
0 1.062790 0.000000 0.000000 0.000000 1.062790 100.396127 0.000000 4.609124 0.000000
1 1.081085 0.000000 0.000000 0.000000 0.018295 98.697142 0.000000 4.592056 0.000000
2 1.104370 0.000000 0.000000 0.000000 0.023285 96.616170 0.000000 4.570746 0.000000
3 1.126823 0.000300 0.000185 0.000185 0.022453 94.691003 0.000098 4.550619 0.009212
4 1.150108 0.000599 0.000370 0.000185 0.023285 92.773896 0.000098 4.530165 0.009035
5 1.179214 0.000599 0.000370 0.000000 0.029106 90.484000 0.000000 4.505173 0.000000
6 1.204994 0.000599 0.000370 0.000000 0.025780 88.548159 0.000000 4.483547 0.000000
7 1.224121 0.000898 0.000555 0.000185 0.019127 87.164586 0.000136 4.467798 0.011734
8 1.258217 0.000898 0.000555 0.000000 0.034096 84.802542 0.000000 4.440326 0.000000
9 1.283165 0.000898 0.000555 0.000000 0.024948 83.153764 0.000000 4.420691 0.000000
10 1.335556 0.001198 0.000740 0.000185 0.052391 79.891820 0.000059 4.380673 0.004633
11 1.377136 0.001198 0.000740 0.000000 0.041580 77.479639 0.000000 4.350015 0.000000
12 1.407074 0.001497 0.000925 0.000185 0.029938 75.831122 0.000115 4.328509 0.008593
13 1.477760 0.001797 0.001111 0.000185 0.070686 72.203876 0.000054 4.279494 0.003783
14 1.524330 0.001797 0.001111 0.000000 0.046570 69.997966 0.000000 4.248466 0.000000
15 1.552605 0.002096 0.001295 0.000185 0.028275 68.723210 0.000148 4.230087 0.010055
16 1.634102 0.002096 0.001295 0.000000 0.081497 65.295802 0.000000 4.178928 0.000000
17 1.721420 0.002096 0.001295 0.000000 0.087318 61.983711 0.000000 4.126872 0.000000
18 1.767990 0.002096 0.001295 0.000000 0.046570 60.351020 0.000000 4.100178 0.000000
19 1.805412 0.002396 0.001481 0.000185 0.037422 59.100084 0.000151 4.079232 0.008852
fig, axes=plt.subplots(nrows=2, ncols=2, figsize=(10, 10))
data1.plot(ax=axes[0,0], x='Radius', y='V',color='y', logx=True)
data1.plot(ax=axes[0,1], x='Radius', y='DVr', logx=True)
data1.plot(ax=axes[1,0], x='Radius', y='dvdp', color='y', logx=True)
data1.plot(ax=axes[1,1], x='Radius', y='Dvlnr', logx=True)
plt.tight_layout()
#plt.savefig("out.png")
plt.show(block=False)
我得到以下错误
MatplotlibDeprecationWarning:
The is_first_col function was deprecated in Matplotlib 3.4 and will be removed two minor releases later. Use ax.get_subplotspec().is_first_col() instead.
if ax.is_first_col():
我读了几篇文章,做了所有的建议,比如plt.show(block=False)
问题仍然存在。
以下是该警告的快照,该警告表示您安装的pandas版本正在matplotlib中使用不推荐的功能。这是固定的,已于4月初合并
您可以从github上的主分支安装pandas,也可以等待下一个pandas版本,该版本可能包含此修复程序。(11天后发布的1.2.4版)。什么是对象数据1?@Jody Klymak,数据1是我的数据帧,数据1=pd.read_csv('final.csv')类型(数据1):pandas.core.frame.DataFrame;而Radius、V和DVr是我的数据中的列。@JohanC,谢谢,有什么办法可以整理出来吗?因为在使用Jupiter笔记本时,它看起来不太好看。谢谢你的回答,你能建议如何从GitHub的主分支安装Pandas吗?我正在使用PyCharm作为IDE。@akshahi17您可以在以下位置查看文档。但请注意,主分支可能有尚未发现的新错误,因此,如果出现问题,请怀疑。禁用会话中的此类警告可能更简单。关于堆栈溢出,也有很多内容。谢谢,我将在这个阶段禁用这些警告,而不是从源代码安装Panda。如果你认为这个问题准确的话,我可以请你投赞成票吗?我需要10分才能在提问时嵌入图像,但我不能这样做,因为这是一个很低的点。@akshahi17要求投票通常是不好的形式。我没有对你的问题投赞成票,因为它没有包含一个。如果您添加了相关的导入和一些虚拟数据,使其能够按原样运行,那么我还是会向上投票。(如果您有一个MCVE,那么您通常甚至不需要嵌入图像,因为人们可以在本地复制您的问题。)