draw a graph on the screen