We want to reproduce the Global Land-Ocean Temperature index plot below (available at this GISS website). Download the data this link and recreate the plot as closely as you can (don't worry about the two green points or matching the font). We've broken up this problem into steps to get you started. Feel free to follow them as you wish, or be a lone wolf and solve this on your own.
- Save the data as a text file, and then read the data into a numpy array. You'll have to deal with the extra lines at the top and bottom of the file, as well as the missing values (the asterixes) that appear. There are multiple ways to solve these problems; do what works for you. If you get stuck, remember that we talked about slicing arrays at the beginning of this lecture.
- Plot "Annual Mean" as a set of black squares connected by a thick black line. Try Googling something about "matplotlib square markers". Don't forget to give it a label so it can go in the legend later.
- Plot "5-Year Running Mean" as a thick red line. Don't forget the label.
- Set the x and y ranges of your plot so that they match the ones in the plot we are trying to recreate.
- Add a grid. The default grid that shows up is fine; don't worry about making it match exactly.
- Label the y axis. Don't worry about the "degree" symbol for now.
- Add the title.
- Add the legend (default settings are fine).
BONUS TASKS:
- Notice how, in the the plot above, there are labels at every 20 years along the x axis but grid marks at every ten (and similar for the y axis)? Figure out how to recreate this.
- On that note, match the formatting they have for the y axis ticks.
- Make all the font sizes match (yours are probably smaller than you'd like).
- Add in the "degree" symbol for the y axis label. Hint: LaTeX or unicode.
- Move the legend to the right place. Remove the box (the "frame") that surrounds the legend. Notice how your legend has a line with two markers for "Annual mean" and their legend has a line with only one marker? Match that.
- Move the title up a little bit so the spacing better matches the plot above.