{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "
Info
\n", " Matplotlib is a python 2D plotting library which produces publication quality figures in a variety of hard-copy formats and interactive environments across platforms.\n", "Note:
\n", " We could have explicitly created the hours list object as follows: hours = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23]
range
function, is quicker, both in terms of typing and execution time.\n",
" Note:
\n", " The terminology takes a bit of getting used to as axes are not the same thing as an x- and y-axis. Instead, think of axes as one distinct plot on a canvas, where the canvas is represented by figure.\n", "Info
\n", " By default,ax.plot
will create a line plot, as seen below \n",
"Question
\n", " Let's say you added one more time value to thehours
array above, while not adding a corresponding value to the temps
array. Do you think the plot you made above would still work? Why or why not? Copy the code cell above into a new code cell below to test your hypothesis.\n",
"Note
\n", " In theax.set_ylabel
call, we represented the degree symbol using Warning:
\n", " It's very easy to make a figure that either intentionally or unintentionally deceives the viewer! In this case, at first glance it appears that the temperature and dewpoint span the same range of values. But note the different y-axes!\n", "Info
\n", " You may wish to move around the location of your legend - you can do this by changing theloc
argument in ax.legend()
\n",
"