If I make a tree using networkx, by default the nodes have integer ids. I would like to visualise the tree with the integers labelling the nodes. So instead of:
import matplotlib.pyplot as plt
import networkx as nx
T = nx.generators.balanced_tree(2, 2)
nx.draw(T)
plt.show()
How can I write the integer labels inside the nodes?