Added matplotlib code to show the graph