Effective Data Visualization With Python Notes V1.01
Effective Data Visualization With Python Notes V1.01
Effective Data Visualization Notes Copyright © 2022 by Krisolis LTD, Dublin, Ireland. All rights reserved.
No part of this publication may be reproduced, transmitted, in any form or by any means, electronic,
mechanical, or otherwise, without the prior written permission of the publisher, Krisolis.
1
13/10/2022
Introductions
2
13/10/2022
3
13/10/2022
4
13/10/2022
Visualization Fundamentals
10
In this
section we
will take
inspiration
from some
great data
visualisations
to get us
started!
11
5
13/10/2022
Hans Rosling TED Talk: The Best Stats You’ve Ever Seen
www.ted.com/talks/hans_rosling_shows_the_best_stats_you_ve_ever_seen.html
12
Hans Rosling
https://www.youtube.com/watch?v=hVimVzgtD6w
13
6
13/10/2022
Purpose of
Data 1. To tell a story and communicate
Visualisation insights in an effective manner
14
Adapted from “The Visual Display of Quantitative Information”, Graphics Press USA, 2001
www.edwardtufte.com/tufte/books_visex
15
7
13/10/2022
16
17
8
13/10/2022
21
Purpose of
Data 2. To solve a problem
Visualisation
22
9
13/10/2022
23
www.vam.ac.uk/vastatic/microsites/1331_modernism/highlights_19.html
24
10
13/10/2022
www.vam.ac.uk/vastatic/microsites/1331_modernism/highlights_19.html
25
29
11
13/10/2022
Other City
Metro Maps
now use the
same format
30
Purpose of
Data 3. To display data in the most
Visualisation informative form, making it easy to
uncover trends
31
12
13/10/2022
Anscombe’s Quartet
▪ Frank Anscombe was an English statistician
- Made significant contributions in design
of experiments and regression methods
- An early proponent of
statistical computing
and stressed that
"a computer should
make both calculations
and graphs”
35
Purpose of
Data 4. To uncover hidden trends in data
Visualisation that sometimes can be hidden by
simply looking at statistical output
36
13
13/10/2022
37
Workshop
38
14
13/10/2022
Introduction to Charting
with Python
39
40
15
13/10/2022
IEEE
Spectrum
Programming
Language
Ranking
https://spectrum.ieee.org/top-programming-languages/
41
42
16
13/10/2022
THE SCIPY
ECOSYSTEM
43
44
17
13/10/2022
Jupyter
display Pandas SciPy
math Python
Standard
Library
seaborn
scikit-learn plotly
45
46
18
13/10/2022
47
48
19
13/10/2022
www.scipy.org
49
pandas.pydata.org
50
20
13/10/2022
www.matplotlib.org
51
52
21
13/10/2022
53
54
22
13/10/2022
55
56
23
13/10/2022
57
58
24
13/10/2022
pd.Series.plot(kind='line'
figsize=None,
Pandas Plots title=None,
grid=None,
legend=False,
xticks=None, yticks=None,
xlim=None, ylim=None,
colormap=None)
pandas.plot:
pandas.pydata.org/pandas-
docs/stable/generated/pandas.S
eries.plot.html
59
60
25
13/10/2022
populations.plot(kind = "bar")
Pandas Plots
61
62
26
13/10/2022
pd.Series.plot(kind='line'
figsize=None, The chart
Pandas Plots title=None, title text
grid=None,
legend=False,
xticks=None, yticks=None,
xlim=None, ylim=None,
colormap=None)
pandas.plot:
pandas.pydata.org/pandas-
docs/stable/generated/pandas.S
eries.plot.html
63
pd.Series.plot(kind='line'
figsize=None,
Pandas Plots title=None, Should grid
lines be shown -
grid=None, True or None
legend=False,
xticks=None, yticks=None,
xlim=None, ylim=None,
colormap=None)
pandas.plot:
pandas.pydata.org/pandas-
docs/stable/generated/pandas.S
eries.plot.html
64
27
13/10/2022
pd.Series.plot(kind='line'
figsize=None,
Pandas Plots title=None,
Should a
grid=None, legend be
legend=False, shown (True
or False)
xticks=None, yticks=None,
xlim=None, ylim=None,
colormap=None)
pandas.plot:
pandas.pydata.org/pandas-
docs/stable/generated/pandas.S
eries.plot.html
65
pd.Series.plot(kind='line'
figsize=None,
A sequence
Pandas Plots title=None,
of values to
grid=None, use for the
legend=False, x or y axis
tick marks
xticks=None, yticks=None,
xlim=None, ylim=None,
colormap=None)
pandas.plot:
pandas.pydata.org/pandas-
docs/stable/generated/pandas.S
eries.plot.html
66
28
13/10/2022
pd.Series.plot(kind='line'
figsize=None,
Pandas Plots title=None,
grid=None,
legend=False,
xticks=None, yticks=None,
xlim=None, ylim=None,
A tuple giving
colormap=None)
the x or y axis
pandas.plot:
pandas.pydata.org/pandas- display limits
docs/stable/generated/pandas.S
eries.plot.html
67
68
29
13/10/2022
Pandas Plots
1. Data
Visualisations
in Python
69
70
30
13/10/2022
71
Tableau Demo
72
31
13/10/2022
Understanding
Perception Theory and
Visual Encodings
73
74
32
13/10/2022
Let’s Start
with
some Hans
Magic
75
Let’s Look at
the
Characteristics
of the Chart
Position
76
33
13/10/2022
Let’s Look at
the
Characteristics
of the Chart
Colour
77
Let’s Look at
the
Characteristics
of the Chart
Size
78
34
13/10/2022
Let’s Look at
the
Characteristics
of the Chart Animation
79
Why did
Hans choose Lets see if we can uncover why these
these specific specific data encodings were chosen
encodings? by Hans?
80
35
13/10/2022
SEEING IS BELIEVING?
81
36
13/10/2022
83
84
37
13/10/2022
A B C D
85
This looks
better
86
38
13/10/2022
Perception
87
88
39
13/10/2022
89
VISUAL ATTENTION
90
40
13/10/2022
Visual Attention
▪ Visual attention refers to the various mechanisms that
help determine which regions of an image are selected
for detailed analysis by our vision system
▪ At any instant detailed information of shape and colour
is only possible in a small portion of our visual field -
about the size of your thumbnail viewed at arm’s length
a j g n t b f y d k e i f h t a j g n t b f y d k e i f h t
d t n j f o s e w b h t w u i d t n j f o s e w b h t w u i
y b a s g r c h y i j n g f s y b a s g r c h y i j n g f s
y v f d s p l b n h g h n j n y v f d s p l b n h g h n j n
Healey, Christopher and Enns, James, Attention and Visual Memory in Visualization and Computer Graphics, IEEE Transactions on Visualization and Computer Graphics,
vol 18 (7), pp 1170--1188, 2012
www.csc.ncsu.edu/faculty/healey/download/tvcg.11.pdf
91
92
41
13/10/2022
93
- size - position
Common,
Useful Pre-
- shape - colour (hue)
Attentive
Properties
94
42
13/10/2022
VISUAL ENCODINGS
95
96
43
13/10/2022
Pre-attentive
Encoding Example Chart Types
property
Scatter Plot, Geo.
Position Yes
Map
Length Yes Bar Chart
97
98
44
13/10/2022
99
100
45
13/10/2022
The Data
Visualisation
Zoo
101
Geography
Composition
The Data Highlight
Trends in a
Visualisation Tabular
Zoo Structure
Composition
Trend over
Time
Precision is
Important
102
46
13/10/2022
An Example
103
80%
United Kingdom
60%
Ireland 40%
20%
France 0%
France Ireland United Kingdom
€0 €100,000 €200,000 €300,000 €400,000 €500,000 €600,000 €700,000
104
47
13/10/2022
DATA VISUALIZATION
ZOO
105
106
48
13/10/2022
Tableau Demo
107
Making Visualisations
More Effective
108
49
13/10/2022
Section
Outline
109
COLOUR THEORY
110
50
13/10/2022
111
A Note on
Colour
112
51
13/10/2022
113
115
52
13/10/2022
117
118
53
13/10/2022
Colour
Spectrums
119
Colour Blindness
▪ There are a few simple things we
can do to address colour blindness:
- Try to use monochromatic
scales when using colour
with continuous data
- Use redundant encodings
whenever colour is used to
present categories - for example
use shape and colour
- There are colour blind safe
palettes that can be used http://colorlab.wickline.org/colorblind/colorlab/
120
54
13/10/2022
Use of
Redundant
Encodings
121
Use of
Redundant
Encodings
http://www.juiceanalytics.com/
122
55
13/10/2022
Creating
Colour
Palettes with
Coolors
Online Tool
www.coolors.co
123
124
56
13/10/2022
125
Edward Tufte
126
57
13/10/2022
127
Data − Ink
Data−ink ratio =
Total ink used to print the graphic
Data – Ink
Ratio
▪ Another way of interpreting the data-ink ratio
is the proportion of a visualisation’s ink
assigned to the non-redundant display of
data-information
128
58
13/10/2022
139
140
59
13/10/2022
Building Dashboards
that People will Love to
Use
141
Sample
Dashboards
Google Analytics:
analytics.google.com
142
60
13/10/2022
Sample
Dashboards
https://ig.ft.com/sites/numbe
rs/economies/us/
143
144
61
13/10/2022
145
146
62
13/10/2022
147
148
63
13/10/2022
Actionable
Choosing The
Perfect KPI Accessible
credible Common
data Interpretation
Transparent simple
calculation
149
150
64
13/10/2022
151
DASHBOARD
STRUCTURE
152
65
13/10/2022
153
Layout &
Attention
154
66
13/10/2022
Layout &
Attention 1 4 6
3 2 8
5 7 9
155
156
67
13/10/2022
157
158
68
13/10/2022
159
160
69
13/10/2022
“Visualizing Data: Exploring and Explaining Data with the Processing Environment”, B. Fry, O'Reilly Media, 2007
http://shop.oreilly.com/product/9780596514556.do
161
162
70
13/10/2022
Define Acquire
Represent Explain Refine Present
Questions Data
163
Define Acquire
Represent Explain Refine Present
Questions Data
164
71
13/10/2022
Define Acquire
Represent Explain Refine Present
Questions Data
165
Define Acquire
Represent Explain Refine Present
Questions Data
Choose a basic
set of visual
encodings, such
as a bar graph,
line graph, tree
etc.
166
72
13/10/2022
Define Acquire
Represent Explain Refine Present
Questions Data
Explain the
patterns visualised
to answer the
analytics
questions
167
Define Acquire
Represent Explain Refine Present
Questions Data
Refine the
visualisations created
to better understand
the data or answer
different questions
168
73
13/10/2022
Define Acquire
Represent Explain Refine Present
Questions Data
Present
visualisations to
business
stakeholders
169
“Visualizing Data: Exploring and Explaining Data with the Processing Environment”, B. Fry, O'Reilly Media, 2007
http://shop.oreilly.com/product/9780596514556.do
170
74
13/10/2022
171
172
75
13/10/2022
Tableau Demo
173
Workshop
174
76
13/10/2022
Thank You
175
References
1. Visualizing Data 3. Beautiful 4. The Big Book of
Ben Fry Evidence Dashboards
Edward Tufte Wexler, Shaffer &
Cotgreve
2. Semiology of 4. Beautiful
Graphics Visualisation
Jacques Bertin Steele & Illinsky
176
77
13/10/2022
177
78