I have a python3 script using the networkx and matplotlib libraries. An example sample is as follows:
When the script get's to: nx.draw(G), the following error message is displayed:
It seems that this is an issue of 'matplotli.cbook' being deprecated since version 3.0 of matplotlib. Is there any way to get around this issue since the py37-networkx package requires py37-matplotlib and the py37-matplotlib package is currently at the 3.3.1 version of matplotlib?
Code:
#! /usr/bin/env python3
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import networkx as nx
if __name__ == '__main__':
vertices = range(1, 10)
edges = [(7,2), (2,3), (7,4), (4,5), (7,3), (1,6), (1,7), (2,8), (2,9)]
G = nx.Graph()
G.add_nodes_from(vertices)
G.add_edges_from(edges)
nx.draw(G)
plt.savefig("node.png")
When the script get's to: nx.draw(G), the following error message is displayed:
Code:
Traceback (most recent call last):
File "./05_imaging.py", line 17, in <module>
nx.draw(G)
File "/usr/local/lib/python3.7/site-packages/networkx/drawing/nx_pylab.py", line 126, in draw
draw_networkx(G, pos=pos, ax=ax, **kwds)
File "/usr/local/lib/python3.7/site-packages/networkx/drawing/nx_pylab.py", line 278, in draw_networkx
edge_collection = draw_networkx_edges(G, pos, arrows=arrows, **kwds)
File "/usr/local/lib/python3.7/site-packages/networkx/drawing/nx_pylab.py", line 563, in draw_networkx_edges
if not cb.iterable(width):
AttributeError: module 'matplotlib.cbook' has no attribute 'iterable'
It seems that this is an issue of 'matplotli.cbook' being deprecated since version 3.0 of matplotlib. Is there any way to get around this issue since the py37-networkx package requires py37-matplotlib and the py37-matplotlib package is currently at the 3.3.1 version of matplotlib?