Now we want to look at another type of plot, which is the line.
Plot and line plots are great when we want to create the sketch of a data set where there's a continuous
relationship between the data points.
For example, time and temperature are both great examples of this.
So for instance, if we have the average high temperature in degrees Fahrenheit for each month in a
city, then we can display each month along the horizontal axis of our line plot and then sketch in
each of these average high temperatures in line with the corresponding month.
And our line plot would look something like this.
So we have the months along the horizontal axis and then along the vertical axis, we have this range
of temperatures in degrees Fahrenheit and we can see that here in January, we've plotted 69 degrees
Fahrenheit.
In February, we've plotted 73 degrees, in March, we've plotted 78 degrees, etc. And once we plot
all of those points, we connect them with a line.
Now, realize here that connecting all of the data points in a scatterplot with a line like this one
wouldn't make sense.
Because if you remember when we looked at scatter plots, the dots were all over the place.
They don't necessarily connect to each other in a logical way.
The crucial thing here is that we use a line plot when the values in between each point on our line
plot make sense.
So, for instance, the average high in January is 69 degrees Fahrenheit.
The average high in February is 73 degrees Fahrenheit.
It makes sense to think about the temperature increasing from 69 degrees to 73 degrees between January
and February.
Those in between values of 70, 71, 72 degrees, for example, make sense.
And so connecting these temperature values with a line gives us a logical kind of plot.
Whereas connecting the points in a scatterplot with a line doesn't make sense.
That's why we used the trend line to sketch a trend through the scatterplot.
Whereas we use a line like this one to connect data points where the values in between each point make
sense in the context of the kind of data we have.
So we said this works well for things like temperature.
Also for any kind of measurement of time.
If we have some measurement of time along the vertical axis, maybe in minutes, let's say here instead
we have 60 minutes, 70 minutes, 80 minutes, 90 minutes instead of degrees Fahrenheit.
The values in between there make sense between 60 minutes and 70 minutes.
We have all those continuous time values.
So it's logical if we have data in terms of time to use a line plot for a representation of that data
set.
In other words, we use line plots to show changes over time or a connection between data points.
So if showing that connection doesn't really make sense, then a line plot probably isn't the best plot
to use.
To give a counter example, let's say we're keeping track of the number of times that the Summer Olympics
has been hosted on each continent.
And so along the horizontal axis, we have continents like Europe.
Asia, North America, etc., along the horizontal axis.
And then we have a count along the vertical axis for the number of times that each continent has hosted
the Summer Olympic Games.
Well, in theory, we could plot the value for each continent, plot the value for Europe, for Asia,
for North America, and connect them with the line.
But it doesn't really make sense to connect those discrete data points with a line because they're not
really related to each other.
Or another way to put it, there's no in between values between Europe and Asia or between Asia and
North America that make sense.
These are just discrete buckets or discrete categories that are separate from one another.
And so we wouldn't connect those data points with a line graph, whereas something like these temperature
values have those in between values, we can connect them with a line plot and it makes a lot more sense.
Now, whenever we have a line plot, we want to be able to interpret what we're seeing.
Of course, each point along the line graph gives us a particular value, but we can also look at the
slope or the change between certain points.
For instance, let's look here at the change between August and September.
So here we're at August and then here is September and then this is October.
What we can see is that the change between August and September is much less than the change between
September and October.
And we see that reflected in the slope of each line.
The slope between August and September is much shallower, whereas the slope between September and October
is much steeper.
So the steeper each segment is, the bigger the change in this case in temperature, the more shallow
the particular segment, the less change in temperature we have.
So a line plot can help us see where the greatest rate of change occurs and where the least amount of
change occurs.
For instance, the change up here between June, July, August, September is pretty shallow.
There's not a lot changing.
The temperature is pretty consistent.
But to go, for instance, from March to June, the temperature is changing significantly every month.
To go from September to December, the temperature's falling off significantly every month.
So we want to pay attention both to the values along the line plot, but also to the change in between
each value, because that slope, depending on how shallow or how steep it is, gives us a good idea
of the rate of change in that part of the data.
The last thing we want to say about line plots is that there's another type of line plot we want to
be aware of, and that specific kind of plot is called an O Jive.
And it looks like this basically, it's just an accumulating line plot.
So for this particular example, we again have months along the horizontal axis.
And then we have revenue along the vertical axis.
Remember that all of these graphs and plots we're looking at are all about displaying information in
the way that makes the most sense or communicates the data most clearly.
So to take this example, if we have revenue data, in other words, the revenue that our company earns
each month of the year, we could certainly take that data and create a line plot and that would be
useful because we'd be able to see the revenue earned each month.
But maybe instead what we're trying to communicate is more about the total revenue for the year and
less about our month to month revenue.
As you can imagine, the line plot would do a better job communicating the month to month revenue,
whereas if we use an O five where the values in our data set accumulate, then we'll get a much better
picture of revenue for the entire year.
So what the OGI shows here for December is not just the revenue we earned in December, it's the revenue
we earned over the course of the entire year.
This value here representing November is the revenue we've earned up and through November, this data
point above October is the revenue we've earned up and through October.
So every month that goes by as we earn more and more revenue, this line is always going to grow, assuming
our revenue is always positive.
And you can imagine how this jive of revenue gives us a different picture of what's happening than we
get from a line plot of revenue and which one we should use really just depends on what we're trying
to communicate and which of these does a better job of communicating.
Our point.
Keep in mind here also that we're showing two different kinds of line plots and lives here in this line
plot.
We've sketched in these points indicated by these dots along the way where is this has no dots.
It's just a collection of line segments.
We can sketch a line, plot or an octave.
Either way, we can include these little dots as points for the line plot or for the five, or we can
exclude them and have a line that looks like this, just a collection of a bunch of segments for both
a line plot and an F both are acceptable.
And then finally, we just want to say that in the same way that a line plot is only appropriate for
certain types of data, Ogi lives are also only appropriate for certain types of data.
For instance, even though a line plot works really well for temperature data, an O jive doesn't really
make sense at all for temperature data.
If we're working here with this temperature data, we would show a temperature of 69 for January, but
then a temperature of 69 plus 73 or 142 degrees for February.
And in the context of temperature, it makes no sense to show an accumulated 142 degrees for February.
So this kind of temperature data is nonsensical in an OGI, but revenue data works really well.
So again, just paying attention to which kind of plot makes sense for the kind of data we have.
And then with both line plots and drives, the last thing we want to say is that we can also plot multiple
series on the same graph.
So for example, with this temperature data, this blue line plot could represent one particular city
and the red line plot could represent another city.
Plotting them together on the same set of axes gives us a great way to compare average high temperatures
across multiple cities.
So line plots are particularly useful for seeing the comparison that way.
And of course, we can do the same thing with an five.
Maybe instead of plotting revenue accumulation over the course of a year for our entire business, we
want to divide the business up into different departments or different lines of business, different
segments of our business.
For instance, maybe we have a business where we sell products online and also in person at conferences
all over the country where we set up a booth and sell product and so we could plot in an off here revenue
accumulation for our online business in blue over the course of the year, and then revenue accumulation
for our in-person business at conferences in red over the course of the year.
And that would allow us to see the comparison between those two parts of our business in the same graph,
in the same five.