drawing graph with networkx and matplotlib
cleanup drawing logic