%matplotlib inline
import networkx as nx
import matplotlib.pyplot as plt
G = nx.Graph()
G.add_node('abc@gmail.com')
nx.draw(G, with_labels=True)
plt.show()
The output figure is
What I want is
I have thousands of email records from person@email.com to another@email.com in a csv file, I use G.add_node(email_address)
and G.add_edge(from, to)
to build G. I want keep the whole email address in Graph G but display it in a simplified string.