Exercise: Plotting Temperatures

In this lesson, you will be plotting the sea and land temperatures of Seattle.

We'll cover the following

Task #

In this exercise, you will plot the average monthly temperature of land and sea for Seattle.

Problem statement #

The average temperatures for land and sea are given in the arrays land_temp and sea_temp.

  • Create one plot with two graphs above each other using the subplot command.

  • On the top graph, plot the land and sea temperatures. Label the ticks on the horizontal axis as jan, feb, mar, apr

  • On the bottom graph, plot the difference between land and sea temperature.

  • Add legends and axes labels to make your graph more readable.

Don’t forget to use savefig(output/filename.png) to save and view the graph.

Get hands-on with 1200+ tech skills courses.