Exercise4 to generate 2D plot with axes