我最近重新安裝了matplotlib,我注意到,我寫幾個月前(這是完全功能),它使用networkx生成圖形輸出的代碼,現在正在輸出錯誤控制檯。我得到的錯誤在下面詳述。Networkx錯誤與Matplotlib
C:\Python36\lib\site-packages\networkx\drawing\nx_pylab.py:126: MatplotlibDeprecationWarning: pyplot.hold is deprecated.
Future behavior will be consistent with the long-time default:
plot commands add elements without first clearing the
Axes and/or Figure.
b = plt.ishold()
C:\Python36\lib\site-packages\networkx\drawing\nx_pylab.py:138: MatplotlibDeprecationWarning: pyplot.hold is deprecated.
Future behavior will be consistent with the long-time default:
plot commands add elements without first clearing the
Axes and/or Figure.
plt.hold(b)
C:\Python36\lib\site-packages\matplotlib\__init__.py:917: UserWarning: axes.hold is deprecated. Please remove it from your matplotlibrc and/or style files.
warnings.warn(self.msg_depr_set % key)
C:\Python36\lib\site-packages\matplotlib\rcsetup.py:152: UserWarning: axes.hold is deprecated, will be removed in 3.0
warnings.warn("axes.hold is deprecated, will be removed in 3.0")
Traceback (most recent call last):
File "C:\Users\lukec\Dropbox\University\Year 2 Semester 2\ICS2210 Data Structures and Algorithms II\Assignment\launcher.py", line 33, in <module>
graph.draw()
File "C:\Users\lukec\Dropbox\University\Year 2 Semester 2\ICS2210 Data Structures and Algorithms II\Assignment\graph.py", line 122, in draw
nx.drawing.nx_pydot.write_dot(G, "graph.dot")
File "<decorator-gen-232>", line 2, in write_dot
File "C:\Python36\lib\site-packages\networkx\utils\decorators.py", line 220, in _open_file
result = func(*new_args, **kwargs)
File "C:\Python36\lib\site-packages\networkx\drawing\nx_pydot.py", line 43, in write_dot
P=to_pydot(G)
File "C:\Python36\lib\site-packages\networkx\drawing\nx_pydot.py", line 175, in to_pydot
import pydotplus
ModuleNotFoundError: No module named 'pydotplus'
程序還是功能正常不過,我得到正確的計算和圖形輸出爲我做之前,唯一的區別是不同的前瞻性matplotlib:
我的問題是:
難道這是由於matplotlib最近更新了 這個事實,而networkx似乎在使用事物從它哪裏是 過時? (Matplotlib已於上個月更新,我相信)。從我的代碼可能是 ?有什麼我可以做,以防止這些錯誤?
我很感激任何幫助。
感謝 - 他們是很煩人的。你知道是否有辦法壓制他們? –
@LukeCollins如果您還沒有找到它,請參閱我剛添加的鏈接。 – Joel
嗨,Joel,謝謝你:) –