SBFT Tool Competition 2024 -- Python Test Case Generation Track
Bar graphs and histograms
1. Bar Graphs andBar Graphs and
HistogramsHistograms
PRINCESS C. BARCEGA
APG SCHOOL, MANAMA, BAHRAIN
Powerpoint hosted on www.worldofteaching.com
Please visit for 100’s more free powerpoints
2. What do you know aboutWhat do you know about
bar graph?bar graph?
double bar graph?double bar graph?
Histogram?Histogram?
3. Bar GraphBar Graph
0 200 400 600 800 1000
English
Hindi
Mandarin
Spanish
A bar graph canA bar graph can
be used tobe used to
display anddisplay and
compare datacompare data
The scaleThe scale
should includeshould include
all the dataall the data
values and bevalues and be
easily dividedeasily divided
into equalinto equal
intervals.intervals.
4. How to interpret a Bar GraphHow to interpret a Bar Graph??
How many of Mr.How many of Mr.
Snowden’sSnowden’s
students arestudents are
band members?band members?
How many of Mr.How many of Mr.
Snowden’sSnowden’s
students are notstudents are not
band members?band members?
01234567
Female
band
Female not
band
Male band Male not
band
The bar graph shows Mr. Snowden’sThe bar graph shows Mr. Snowden’s
students by gender and bandstudents by gender and band
membershipmembership..
5. Double Bar GraphDouble Bar Graph
0
10
20
30
40
50
60
70
80
90
1st
Qtr
2nd
Qtr
3rd
Qtr
4th
Qtr
Can be used toCan be used to
compare twocompare two
related sets ofrelated sets of
datadata
6. How to make a Double-BarHow to make a Double-Bar
GraphGraph??
Choose a scale and intervalChoose a scale and interval
for the vertical axis.for the vertical axis.
Draw a pair of bars for eachDraw a pair of bars for each
country’s data. Use differentcountry’s data. Use different
colors to show males andcolors to show males and
females.females.
Label the axes and give theLabel the axes and give the
graph a titlegraph a title..
Make a key to show whatMake a key to show what
each bar represents.each bar represents.
7. The table shows the highwayThe table shows the highway
speed limits on interstatespeed limits on interstate
roadsroads ..within three stateswithin three states
StateState UrbanUrban RuralRural
FloridaFlorida 65mi/h65mi/h 70 mi/h70 mi/h
TexasTexas 70 mi/h70 mi/h 70 mi/h70 mi/h
VermontVermont 55mi/h55mi/h 65 mi/h65 mi/h
8. Step 1Step 1
Choose a scaleChoose a scale
and interval for theand interval for the
vertical axis.vertical axis.
0
20
40
60
80
StateState UrbanUrban RuralRural
FloridaFlorida 65mi/h65mi/h 70 mi/h70 mi/h
TexasTexas 70 mi/h70 mi/h 70 mi/h70 mi/h
VermontVermont 55mi/h55mi/h 65 mi/h65 mi/h
9. Step 2Step 2
Draw a pair of bars for eachDraw a pair of bars for each
state’s data. Use differentstate’s data. Use different
colors to show urban and rural.colors to show urban and rural.
0
20
40
60
80
Florida Texas Vermont
StateState UrbanUrban RuralRural
FloridaFlorida 65mi/h65mi/h 70 mi/h70 mi/h
TexasTexas 70 mi/h70 mi/h 70 mi/h70 mi/h
VermontVermont 55mi/h55mi/h 65 mi/h65 mi/h
10. Step 3 and 4Step 3 and 4
Label the axes andLabel the axes and
give the graph agive the graph a
title.title.
Make a key toMake a key to
show what eachshow what each
bar representsbar represents
0
20
40
60
80
Florida Texas Vermont
SpeedLimit(mi/h(
Urban
Rural
Speed Limit on Interstate Roads
11. HistogramHistogram
Histogram is a bar graph thatHistogram is a bar graph that
shows the frequency of datashows the frequency of data
within equal intervals.within equal intervals.
There is no space in betweenThere is no space in between
the bars.the bars.
12. How to make a histogramHow to make a histogram??
13. The table below shows the number ofThe table below shows the number of
hours students watch TV in one weekhours students watch TV in one week
Make a histogram of all the dataMake a histogram of all the data..
Number of hours of TVNumber of hours of TV
11 IIII 66 IIIIII
22 IIIIIIII 77 IIII - IIIIIIII - IIII
33 IIII - IIIIIIII - IIII 88 IIIIII
44 IIII - IIIII - I 99 IIIIIIII
55 IIII - IIIIIII - III
14. Step 1Step 1
Make a frequencyMake a frequency
table of the data.table of the data.
Be sure to useBe sure to use
equal intervalsequal intervals
Number of hours of TVNumber of hours of TV
11 IIII 66 IIIIII
22 IIIIIIII 77 IIII - IIIIIIII - IIII
33 IIII - IIIIIIII - IIII 88 IIIIII
44 IIII - IIIII - I 99 IIIIIIII
55 IIII - IIIIIII - III
Number ofNumber of
hours of TVhours of TV
FrequencyFrequency
1-31-3 1515
4-64-6 1717
7-97-9 1616
15. Step 2Step 2
Number ofNumber of
hours of TVhours of TV
FrequencyFrequency
1-31-3 1515
4-64-6 1717
7-97-9 1616
Choose an appropriate scale and interval for the verticalChoose an appropriate scale and interval for the vertical
axis. The greatest value on the scale should be at least asaxis. The greatest value on the scale should be at least as
great as the greatest frequency.great as the greatest frequency.
0
4
8
12
16
20
1-3 4-6 7-9
16. Step 3Step 3
Draw a bar for each interval.Draw a bar for each interval.
The height of the bar is theThe height of the bar is the
frequency for that interval.frequency for that interval.
Bars must touch but notBars must touch but not
overlap.overlap.
Label the axes and give theLabel the axes and give the
graph titlegraph title
Hours of Television
Watched
0
4
8
12
16
20
1-3 4-6 7-9
Hours
Numberofstudents
Number ofNumber of
hours of TVhours of TV
FrequencyFrequency
1-31-3 1515
4-64-6 1717
7-97-9 1616
18. Can you now make a barCan you now make a bar
graph, double bar Graphgraph, double bar Graph
and a histogramand a histogram??
19. The list below shows the results ofThe list below shows the results of
a typing test in words pera typing test in words per
minute. Make a histogram of theminute. Make a histogram of the
data.data.
62, 55, 68, 47, 50, 41, 62, 39, 54,62, 55, 68, 47, 50, 41, 62, 39, 54,
70, 56, 70, 56, 47, 71, 55, 60,70, 56, 70, 56, 47, 71, 55, 60,
4242