You are on page 1of 21

Graphical Representations

STATISTICS AND PROGRAMMING

Laura Anderlucci

University of Bologna
Describing data by graphs

The purpose of graphical representations are:

• to unveil the essential features of the data;


⇒ patterns, trends, relationships, etc.

• to allow the comparison between two or more set of homogeneous


data;

• to simplify data complexity and to report information in an


attractive and effective manner.

1
Bar chart

Bar charts represent frequency distributions by plotting for each value of


a variable X a bar whose height is proportional to the observed frequency.

If the variable is ordinal, the barplot is preferable, as bars on the


horizontal axis allow to grasp the distribution pattern.

Also, bar charts are particularly suitable to represent the distribution of


discrete variables.

2
Bar chart - example

Consider the distribution of the number of exams passed during the first
year by a group of students in Economics:

No. of
ni
exams
0 14
1 41
2 83
3 116
4 56
5 5
Total 315

3
Bar chart - example

4
Pie chart

An alternative to bar charts, for qualitative data, are pie charts. in


which a whole circle is divided into sections whose size (angle ai ) is
proportional to the frequency:

ni
ni : N = ai : 360 ⇒ ai = · 360 = fi · 360
N

5
Pie chart - example

6
“Save the Pies for Dessert”, by Stephen Few

Here is a pie chart with six slices. Notice how easy it is to determine that
the value of Company C (the green slice) is 25%, one quarter of the pie.

7
“Save the Pies for Dessert”, by Stephen Few

Now notice how that even the green slice, which was easy to read as 25%
above, is no longer as easy to recognize as 25% in the chart below:

8
“Save the Pies for Dessert”, by Stephen Few

You might argue that this problem can be easily solved by labeling the
values of each slice, as shown here:

9
“Save the Pies for Dessert”, by Stephen Few

Why stop here? With this pie chart, we’re forced to waste time bouncing
our eyes back and forth between the legend on the right and the slices of
the pie to figure out which slice represents which company.
We can solve this problem by directly labeling the slices with both the
company names and the values, as shown here:

10
“Save the Pies for Dessert”, by Stephen Few

But what if we could display this same information in a graph that is easy
to read; one that adds useful meaning by allowing us to compare the
magnitudes of the values without labeling them? Here’s the same data
displayed in a bar chart:

11
“Save the Pies for Dessert”, by Stephen Few

Here’s another test. Look at the pie chart below and try to place the
slices in order from largest to smallest:

12
“Save the Pies for Dessert”, by Stephen Few

If a chart is doing its job, you shouldn’t have to struggle. Look at how
easy it is to compare the percentages using the bar graph below, which
displays the same values:

13
“Save the Pies for Dessert”, by Stephen Few

People love dressing up their pie charts today to look mouthwatering.


Why stick with a simple 2-D pie chart when you can add a third
dimension of depth to the picture and throw in some lighting effects and
contoured edges while you’re at it, as shown here?

It’s pretty and eye-catching. However, by adding depth to the pie and
changing its angle, we’ve made it more difficult to interpret. 14
“Save the Pies for Dessert”, by Stephen Few

What about tilting?

Notice how different


the relationships be-
tween the slices ap-
pear from one version
to the next.

15
Histogram

A histogram is a graph suitable for representing a grouped frequency


distribution.

It is obtained by reporting the


class endpoints on the x-axis
and the frequency densities on
the y -axis.
The area of each bar equals
the class frequency.

16
Histogram - example

GDP per capita 2017

GDP (k) ni di hi

0⊢ 5 1 5 0.20
5 ⊢ 15 10 10 1.00
15 ⊢ 50 18 35 0.51
50 ⊢ 75 5 25 0.20
75 ⊢ 150 2 75 0.03

Total 36

17
Line chart

The graphical representation of times series uses the cartesian coordinate


system. Times are plotted on the horizontal axis, while the variable’s
values on the y -axis.
The consecutive plotted points are connected with line segments to
enhance the visual perception of the trend.

18
Line chart

Two or more time series can be displayed on the same graph to allow for
their comparison.

19
Thematic maps

20

You might also like