02basic Charts and Plots
02basic Charts and Plots
02basic Charts and Plots
Lecture 2
Basic Charts and Plots
3 72
Content Scatter Plot
• Scatter plot • Range Bar Chart
• Line Chart • Bullet Chart
• (Stacked) Area Chart • Box Plot
• (Multi-set) Bar Chart • Pie Chart
• Histogram • Donut Chart
• (Stacked) Bar Chart
5 6
Basic Charts and Plots- Prof. Mourad Ykhlef Basic Charts and Plots- Prof. Mourad Ykhlef
Year 1950 1955 1960 1965 1970 1975 1980 1985 1990 1995
# of
201 593 616 897 654 919 866 684 1133 1234
Tornadoes
•
• An effective way to see a relationship in data is to 1200
200 •
1950
1955
1960
1965
1970
1975
1980
1985
1990
1995
Basic Charts and Plots- Prof. Mourad Ykhlef
Scatter plots provide a convenient way to determine
correlation exists between two variables.
whether a ___________
positive
A __________ correlation occurs when both •
• • •
variables increase. •
•• • •
• • •
• •
• • •
negative
A ___________ correlation occurs when one variable
• •• •
• •
• •
increases and the other variable decreases. •
If the data points are randomly scattered there is Positive Negative little or no
little
_______ or no correlation. correlation correlation correlation
Basic Charts and Plots- Prof. Mourad Ykhlef Basic Charts and Plots- Prof. Mourad Ykhlef
•
• Example 2: Find the line of best fit for the scatter plot you made
• •• • • •
•
• • • • on the first page. To fit the line to the points, choose your line so
• • • that it best matches the overall trend. The line does not have to
• •
• • ••
• • pass through any of the points.
• •
no correlation
as your age increases as your age
between age
your height also increases increases the time
and eye color
will decrease
2 1 3 Basic Charts and Plots- Prof. Mourad Ykhlef
Use the line of best fit to predict how many tornadoes may be
reported in the United States in 2015 if the trend continues.
If the data points are close to the line of best fit, it is
1200 said to have a ___________correlation.
strong
•
•
1000 ••
• • • • •
• •• •• •• •• •
• • • •
• • • ••
800 • • •
•
• •
•
600 • strong positive
• weak positive
1955
1960
1965
1970
1975
1980
1985
1990
1995
2000
2005
2010
2015
Basic Charts and Plots- Prof. Mourad Ykhlef Basic Charts and Plots- Prof. Mourad Ykhlef
Line Graph
• A line graph is a graph used to show
change over time!!
21 22
Basic Charts and Plots- Prof. Mourad Ykhlef Basic Charts and Plots- Prof. Mourad Ykhlef
Time
23 24
Time in minutes
Money spent this week Miles traveled during the week
$25.00 70
60
Amoutn of $
$20.00
Miles Traveled
50
$15.00 40
$10.00 30
20
$5.00
10
$0.00 0
Mon. Tues. Wed. Thurs. Fri. Mon. Tues. Wed. Thurs. Fri. Sat. Sun.
Day Days
25 26
240
80 220
200
75 180
160
Calories
70 140
120
65 100
80
60 60
40
55 20
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
0
30
60
90
120
150
180
210
240
270
Years Hours
27 28
Basic Charts and Plots- Prof. Mourad Ykhlef Basic Charts and Plots- Prof. Mourad Ykhlef
Do these have the same information on them? (Stacked) Area chart
Test grades
100
Source 50
0
1 2 3 4 5 6
Week
Test grades
90
Source
85
80
75
70
1 2 3 4 5 6
Week 29 30
Basic Charts and Plots- Prof. Mourad Ykhlef
31 32
Basic Charts and Plots- Prof. Mourad Ykhlef Basic Charts and Plots- Prof. Mourad Ykhlef
Stacked Area Charts
• Stacked Area Charts (Graphs) work in the same way as
simple Area Graphs do, except for the use of multiple data
series that start each point from the point left by the
previous data series.
• The entire graph represents the total of all the data plotted.
• Stacked Area Graphs also use area to convey whole
numbers,
so they do not work for negative values.
• Overall, they are useful for comparing multiple variables
changing over an interval.
33 34
Basic Charts and Plots- Prof. Mourad Ykhlef
Basic Charts and Plots- Prof. Mourad Ykhlef Basic Charts and Plots- Prof. Mourad Ykhlef
How to interpret a Bar Chart?
Double Bar Chart
The bar chart shows Mr. Ahmed’s students
by gender and band membership.
90 • Can be used to
80 compare two
70
• How many of Mr.
7
related sets of
60
Ahmed’s students are data
6
50
band members?
5
40
• How many of Mr. 30
4
20
Ahmed’s students are 3 10
not band members?
2
0
1st 2nd 3rd 4th
1
Basic Charts and Plots- Prof. Mourad Ykhlef Basic Charts and Plots- Prof. Mourad Ykhlef
How to make a Double-Bar The table shows the highway speed limits on
Chart? interstate roads within three states
State Urban Rural
• Choose a scale and interval for the vertical axis.
• Draw a pair of bars for each country’s data. Use
different colors to show males and females. Florida 65mi/h 70 mi/h
• Label the axes and give the chart a title.
title.
• Make a key to show what each bar represents.
Texas 70 mi/h 70 mi/h
Basic Charts and Plots- Prof. Mourad Ykhlef Basic Charts and Plots- Prof. Mourad Ykhlef
Step 1 Step 2
• Draw a pair of bars for each state’s
• Choose a scale and 80 data. Use different colors to show
interval for the urban and rural.
vertical axis.
60 80
0
Florida Texas Vermont
Step 3 and 4
Speed Limit on Interstate Roads
Multiset Bar Chart
80
• Label the axes and Urban • Double Bar Chart
give the graph a title. Rural
• Triple Bar Chart
Speed Limit (mi/h)
60
• Make a key to show
what each bar • ------
40
represents
• Multiset Bar Chart
20
0
Florida Texas Vermont
44
Basic Charts and Plots- Prof. Mourad Ykhlef Basic Charts and Plots- Prof. Mourad Ykhlef
The table below shows the number of hours students
watch TV in one week Make a histogram of all the data.
Histogram
Number of hours of TV
• Histogram is a bar graph that shows the frequency
of data within equal intervals. 1 II 6 III
• There is no space in between the bars.
2 IIII 7 IIII - IIII
• The main difference between bar charts and
histograms. 3 IIII - IIII 8 III
– With bar charts, each column represents a
group defined by a categorical variable; 4 IIII - I 9 IIII
– and with histograms, each column represents a
group defined by a continuous, quantitative 5 IIII - III
variable.
Basic Charts and Plots- Prof. Mourad Ykhlef
Step 1 Step 2
• Choose an appropriate scale and interval for the vertical axis. The
• Make a frequency table of the data. Be sure to use equal greatest value on the scale should be at least as great as the
intervals greatest frequency.
20
Number of hours of TV Number of Frequency Number of Frequency 16
1 II 6 III hours of TV hours of TV 12
2 IIII 7 IIII - IIII
8
3 IIII - IIII 8 III 1-3 15 1-3 15
4-6 17 4-6 17 4
4 IIII - I 9 IIII
5 IIII - III 7-9 16 7-9 16 0
1-3 4-6 7-9
Basic Charts and Plots- Prof. Mourad Ykhlef Basic Charts and Plots- Prof. Mourad Ykhlef
Step 3 Can you now make a bar graph,
• Draw a bar for each interval. The Hours of Television
height of the bar is the frequency Watched
double bar Graph and a histogram?
for that interval. Bars must touch
but not overlap.
20
• Label the axes and give the graph
title The list below shows the results of a typing
Number of students
16
12
test in words per minute. Make a histogram
Number of
of the data.
Frequency 8
hours of TV 62, 55, 68, 47, 50, 41, 62, 39, 54, 70, 56, 70,
4
56, 47, 71, 55, 60, 42
1-3 15 0
4-6 17 1-3 4-6 7-9
Hours
7-9 16
Basic Charts and Plots- Prof. Mourad Ykhlef
53 54
Basic Charts and Plots- Prof. Mourad Ykhlef Basic Charts and Plots- Prof. Mourad Ykhlef
55 56
Basic Charts and Plots- Prof. Mourad Ykhlef Basic Charts and Plots- Prof. Mourad Ykhlef
Also known as: Range Bar/Column Chart, Floating Bullet Chart
Bar Chart, Span Chart.
A chart used to display dataset ranges between a
minimum value and a maximum value. It is ideal for
making comparisons of ranges labeled with
categories.
It focuses the reader on only the extreme values and
give no information on the values in between the
minimum and maximum values or on averages or
data distribution.
57 58
Basic Charts and Plots- Prof. Mourad Ykhlef Basic Charts and Plots- Prof. Mourad Ykhlef
59 60
Basic Charts and Plots- Prof. Mourad Ykhlef Basic Charts and Plots- Prof. Mourad Ykhlef
MEAN, MEDIAN, MODE
Box Plot or Whisker Plot
61 62
Basic Charts and Plots- Prof. Mourad Ykhlef Basic Charts and Plots- Prof. Mourad Ykhlef
63
Basic Charts and Plots- Prof. Mourad Ykhlef
Box plot and Outliers
65 66
Basic Charts and Plots- Prof. Mourad Ykhlef Basic Charts and Plots- Prof. Mourad Ykhlef
67 68
Basic Charts and Plots- Prof. Mourad Ykhlef Basic Charts and Plots- Prof. Mourad Ykhlef
Pie Chart
Pie charts
• Aim – visual detection of differences on proportion among several
classes
• Limitation – easy interpretation only with a few data
69 70
Basic Charts and Plots- Prof. Mourad Ykhlef Basic Charts and Plots- Prof. Mourad Ykhlef
71 72
Basic Charts and Plots- Prof. Mourad Ykhlef Basic Charts and Plots- Prof. Mourad Ykhlef
Pie charts : guidelines
• No axe : add labels to show the value of each class, if it is important for the interpretation.
• Labels near the slices rather than a separate legend (particularly with more than 3 classes)
73 74
Basic Charts and Plots- Prof. Mourad Ykhlef Basic Charts and Plots- Prof. Mourad Ykhlef
75 76
Basic Charts and Plots- Prof. Mourad Ykhlef Basic Charts and Plots- Prof. Mourad Ykhlef