Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

networkx draw edge description

import matplotlib.pyplot as plt
import networkx as nx

edges = [['A', 'B'], ['B', 'C'], ['B', 'D']]
G = nx.Graph()
G.add_edges_from(edges)
pos = nx.spring_layout(G)
plt.figure()
nx.draw(
    G, pos, edge_color='black', width=1, linewidths=1,
    node_size=500, node_color='pink', alpha=0.9,
    labels={node: node for node in G.nodes()}
)
nx.draw_networkx_edge_labels(
    G, pos,
    edge_labels={('A', 'B'): 'AB', 
                 ('B', 'C'): 'BC', 
                 ('B', 'D'): 'BD'},
    font_color='red'
)
plt.axis('off')
plt.show()
Comment

PREVIOUS NEXT
Code Example
Python :: pandas read csv file header column not equal data columns 
Python :: programme phyton pour realiser un programme qui transforme une image en niveau de gris 
Python :: TypeError: sequence item 1: expected str instance, NoneType found 
Python :: how to loop over all dates in python 
Python :: Python downsampling 
Python :: join items in set with newline character 
Python :: text files to words generator 
Python :: paho mqtt reconnect in python 
Python :: extract area code from phone number python 
Python :: gwt height with tkinker 
Python :: numpy array majority and how many 
Python :: discord.py custom status 
Python :: cant access a dataframe imported using pickle 
Python :: drop values in column with single frequency 
Python :: featch detail of subscription in stripe api 
Python :: python youtube view bot 
Python :: how to delete a row based on a criteria in python datafram 
Python :: python capitilize 
Python :: cannot access modules from neighbouring directories jupyter notebook 
Python :: write in file python 
Python :: Kivy button on press call function with arguments 
Python :: python set literal 
Python :: random ordered slice of an array 
Python :: pool does not print process id 
Python :: fetch api flask url redirect 
Python :: how to create dll from java code 
Python :: Using a generic exception block 
Python :: python warshall algorithm stackoverflow 
Python :: keep calm and carry on memes 
Python :: xpath h4 contains text 
ADD CONTENT
Topic
Content
Source link
Name
1+4 =