update plot network, it now returns graph object