I have the problem that I have a weighted adjacency matrix C of a directed graph, so C(j,i)=0, whenever there is no edge from j to i and if C(j,i)>0, then C(j,i) is the weight of the edge;
Now I want to plot the Directed Graph. There are many solutions when you manually add edges, see e.g. here:
Add edge-weights to plot output in networkx
But I want to plot edges and edge weights based on my matrix C; I started the following way:
def DrawGraph(C):
import networkx as nx
import matplotlib.pyplot as plt
G = nx.DiGraph(C)
plt.figure(figsize=(8,8))
nx.draw(G, with_labels=True)
This plots a graph and there are labels on the vertices, but there are no edge weights - also I cannot adapt the technic from the upper link to make it work - so what could I do?
And how would I change node size and color?