Error when using matplotlib.pyplot
in jupyter notebook to compose a picture
Error: AttributeError: module'matplotlib. pyplot' has no attribute'ishold',
This problem may be caused by a mismatch between the networkx and matplotlib versions, or the incorrect installation order of the two.
Open Anaconda Powershell Prompt
pip uninstall --user networkx
Wait until neyworkx is successfully uninstalled, then continue to uninstall matplotlib:
pip uninstall --user matplotlib
Still executed in Anaconda Powershell Prompt
pip install --user matplotlib
When matplotlib is successfully installed, you will find that it reminds that the networkx version needs to be >=2
, which may be the main reason for the previous error.
Continue to install networkx
pip uninstall --user networkx
run your own code and you will find that you can plot again.