최근에 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
안녕하세요 조엘, 고맙습니다. :) –