Set the graphics environment. The BORDER goption draws a black border around the graph.
goptions reset=all border;