The second set of contextual elements is made of axes,

grids, and reference lines.

And the main purpose of these elements is to enable value reading and comparison.

So as we have seen before,

many graphs out there encode quantitative information.

But going back from graphical representation to estimating or comparing quantities,

often can be aided by contextual elements.

Let me give you a few examples.

So here we have a line chart,

something that is changing over time.

And if we focus on this specific data point,

and we want to read or at least estimate when these event is happening,

and what is the value that is mapped to the vertical position to the Y-axis,

we have to refer to the axes that you have at the bottom and on the left.

If we didn't have these axes,

it would be impossible to read the values.

Let me give you an example.

This is exactly the same graph,

but I removed all the axes and all the grids, by the way.

So if I ask you to estimate when is this happening and what is the value,

it's basically impossible or very hard to do.

Similarly, if I ask you to compare the value of these two moments,

these two valleys that you can see in the graph, it's quite hard.

You can still estimate it when you actually have the axis shown in the graph.

But what is really interesting here is that if I add a grid,

it becomes easier to actually compare the values.

Look at the difference between the same graph without the grid and with the grid.

With the grid is much easier to refer these values

back to the value that is presented on the vertical axis,

but it's also easier to compare or estimate the difference between these two points.

So that's the value of using axes and grids.

They are very important contextual elements.

Here is another example to introduce the concept of trends, line trends.

Here we have another line chart.

Again something that is changing over time with a number of patterns,

and suppose that I ask you to visually estimate whether

overall the trend of this quantity is going up,

is flat, or it's going down.

It's actually hard to estimate that visually,

especially in a graph like this where you have a lot of times when it goes up,

and then it goes down, and then up again,

then we have a peak, it's really hard.

So what if we add a trend line like this one?

So a trend line is an average across all these values.

And it shows you that across all these values,

despite the many changes the noise that you have in between,

overall, the trend is upward.

This quantity is increasing.

So that's the value of using a trend line like this one.

That's not the only value.

The other value of a trend line is that it gets easier to

compare individual values of the chart to the actual trend line.

So when you look at this chart now,

you can very easily distinguish between

data points that are above the line and data points that are below the line.

And in several cases being able to distinguish,

visually segment points, or marks,

or elements that are above or below,

or on one side or the other side of a given trend line is very useful.

Let me give you another example.

This is a bar chart that describes

data coming from restaurant inspections in New York City.

And what we have on the Y-axis in rows,

we have different types of cuisines.

So we have many restaurants.

Each restaurant belong to a cuisine type.

And here, I've put the least of cuisine types that you have in the dataset.

For each cuisine type,

I've calculated the average score that this cuisine type has.

What is a score? Well, a score is number of points that are assigned by the inspectors to

the restaurants to basically keep track of how good or actually how bad the situation is,

for that specific restaurant.

So in particular here,

a higher score means that the sanitary situation is actually worse.

So an interesting aspect of this graph and this dataset is that,

in New York City,

according to what kind of score a restaurant has,

some letters are assigned to the restaurant.

So A, for instance, means very good,

is the top mark,

and then it's followed by B,

and then by the other letters.

So what I did here is to mark with a line where is

the threshold of the score that identifies A scores to B scores and other scores.

So without the line, it would be much much harder to

identify those categories that are in A,

those categories that are in B,

and those categories that are beyond B.

So that's a different example to explain the same concept.

Having trend lines is very useful to segment the visualization into areas so

that it's easier to understand which graphical objects are on one side or another side.