Lecture 7
Charts
DATA 8
Fall 2017
Slides created by John DeNero (denero@berkeley.edu) and Ani Adhikari (adhikari@berkeley.edu)
Announcements
Census Continued
(Demo)
Data Visualization
Discussion Question
Which of the following questions can be answered by this chart?
Among survey responders...
Pew research center, 2014
Area Principle
Areas should be proportional to the values they represent
Example from Tian Zheng
30% of accidental deaths of males were due to automobile accidents
20% of accidental deaths of females were due to automobile accidents
10%
0%
20%
30%
In 2013,
Numerical Data
(Demo)
How Do You Generate This Chart?
Top 10 highest grossing movies
How long ago each one was released
Types of Data
All values in a column should be both the same type and be comparable to each other in some way
“Numerical” Data
Just because the values are numbers, doesn’t mean the variable is numerical
Terminology
Plotting Two Numerical Variables
Scatter plot: scatter
Line graph: plot
Categorical Data
(Demo)
Bar Charts of Counts
Distributions:
Bar charts can display the distribution of categorical values
(Demo)
Categorical Distributions
bar chart: barh
Displays a categorical distribution
(But when the values of the variable have a rank ordering, or fixed sizes relative to each other, more care might be needed.)