Given an adjacency matrix, How to draw a graph with matplotlib?
I referred to this but I am getting an error
AttributeError: 'list' object has no attribute 'shape'
I have a 2d list with same number of rows and column
class Graph:
def __init__(self,Vertices):
self.V=Vertices
self.graph=[]
self.path=[]
for i in range(self.V):
l=[]
for j in range(self.V):
l.append(0)
self.graph.append(l)
This is what I am doing and for drawing I used the link mentioned above.
Am I missing something or what should I do ?