Effective Data Visualization Techniques
Effective Data Visualization Techniques
1 Introduction
1.1 Basic information
Motivation.
Good visualization can convey large amounts of complex data into the human brain.
This is great to communicate results to others, but also to explore data interactively during
research.
Our brain/visual system can process some types of gures almost without eort. We should
exploit this.
In this lecture we learn about how to represent complex data visually such that our brains
can parse it eciently.
Outline of lecture. Two main parts, complementary to each other. To keep lecture enter-
taining, will alternate between the two blocks.
1
Grammar of graphics
Components of a gure
Dynamic and interactive visualization
How to lie with charts
Software toolbox.
Lecture based on python, numpy; and work mostly with matplotlib
Literature. The following references inuenced this lecture and might be useful.
2
Edward Tufte. The Visual Display of Quantitative Information. Graphics Press, Cheshire, 1983.
Jake VanderPlas. Python Data Science Handbook. O'Reilly, 2022. URL [Link]
[Link]/PythonDataScienceHandbook/.
Hadley Wickham, Danielle Navarro, and Thomas Lin Pedersen. ggplot2: Elegant Graphics for
Data Analysis. URL [Link]
x1 10.00 8.00 13.00 9.00 11.00 14.00 6.00 4.00 12.00 7.00 5.00
y1 8.04 6.95 7.58 8.81 8.33 9.96 7.24 4.26 10.84 4.82 5.68
y2 9.14 8.14 8.74 8.77 9.26 8.10 6.13 3.10 9.13 7.26 4.74
y3 7.46 6.77 12.74 7.11 7.81 8.84 6.08 5.39 8.15 6.42 5.73
x2 8.00 8.00 8.00 8.00 8.00 8.00 8.00 19.00 8.00 8.00 8.00
y4 6.58 5.76 7.71 8.84 8.47 7.04 5.25 12.50 5.56 7.91 6.89
sequences of pairs (x1 , y1 ), (x1 , y2 ), (x1 , y3 ) and (x2 , y4 ) all yield essentially the same linear
regression:
same slope, intercept, correlation coecient, standard error for slope estimation
graphic representation immediately tells us four dierent stories
14 14 14 14
12 12 12 12
10 10 10 10
8 8 8 8
6 6 6 6
4 4 4 4
2 2 2 2
5 10 15 20 5 10 15 20 5 10 15 20 5 10 15 20
3
1.2.2 Historical examples
Chinese cartography
taken from [Tufte: The visual display of quantitative information]
approx 1100 AD
European cartography
taken from [Tufte: The visual display of quantitative information]
1546 by Petrus Apianus, generalization to two-dimensional plots still took some time
4
Playfair
taken from [Tufte: The visual display of quantitative information]
5
Water pumps in London.
taken from [Spence: Information Visualization]
Regency chart
taken from [Tufte: The visual display of quantitative information]
6
Note: George II was the founder of Göttingen University, Wilhelmsplatz is named after
William IV.
Train timetable.
taken from [Tufte: The visual display of quantitative information]
Galaxy distribution.
taken from [Tufte: The visual display of quantitative information]
7
1.2.3 Example by Alberto Cairo: world population
taken from [Cairo: The Functional Art, Chapter 1]
Cairo read book `The Rational Optimist: How Prosperity Evolves' by Matt Ridley
chapter on world population made the hypothesis that it will soon stabilize
provided gure did not support the hypothesis, did not display appropriate data, dierent
simultaneous trends cannot be distinguished in summarized data
showing all individual trajectories not helpful either: all necessary data is shown, but hard
to process visually
nal version: highlight representatives from dierent clusters. supports hypothesis, allows
for further more detailed exploration (e.g. China, Brazil, Niger)
8
2 Data and processing
Literature. Sources for this section were:
[Kirk, 2019, Chapter 4]
9
interval: there is a notion of dierence, but not of ratio
Composite data structures. Primitive types can be combined into more complex data struc-
tures.
lists / tuples: ordered list of entries. Entries may be dierent data types, primitive or
nested lists. In principle can build arbitrarily deep and rich structures.
struct or composite types: dened by set of elds (or variables). Each eld has a specied
data type (can be primitive or another struct). An instance of a struct must provide a
value for each eld (maybe have a convention for missing values).
table / `data frame': a list of instances of the same struct; elds/variables are usually
referred to as columns; dierent entries as rows
time series: measurement of some quantity over time, e.g. temperature evolution through-
out the day. If time interval is regular, it can be represented as one-dimensional array of
values. Otherwise could be list of pairs of time stamp and value (e.g. times when a car
passed on the road + type of car).
functions: abstract denition of a function is list of associated pairs of input and output
values. Computationally and in experiment the concrete representation can vary extremely.
store values at xed locations such as grid points (e.g. image, xed-interval time series)
store pairs of location and values where measurements are available (e.g. weather
measurement stations)
⇒ visualizing functions poses several challenges, high dimensionality, irregular avail-
ability of values, representation of uncertainty
10
2.2 Data processing / pipeline
acquisition
examination
is meant here at very fundamental level: what even is my data? which les? what
types, format, relation? amount and range? Can be very relevant `in the wild'
quality and representativeness? missing values, errors, formatting inconsistencies,
corruption, duplicates, out of date
cleaning / pre-processing
personal recommendations:
keep all iterations/versions of the data (if possible/practical), ideally in a format where
changes can be traced transparently (via di or with dedicated analysis script)
add meta data:
* document source of external data
* for generated / processed data: document used parameters, conventions;
examples: encoded directly in lename; added as comment at beginning
* use meaningful directory structures
automate and standardize cleaning and pre-processing as much as possible via scripts,
save these scripts with the data for documentation
data exploration
more detailed and quantitative than examination: what stories does the data tell?
is it compatible with hypotheses? what are even good hypotheses? are there statisti-
cally signicant dependencies?
usually main challenge: nd clear low-dimensional structure encoded in vast high-
dimensional dataset
`Exploratory data analysis is an attitude, a exibility, and a reliance on display, not
a bundle of techniques, and should be so taught.' (John Tukey: We Need Both
Exploratory and Conrmatory, The American Statistician, 1980)
statistics, visualization, quick exible movement play a key role, will be demonstrated
throughout lecture
main step: actual work on data, extracting information required for visualization
11
use version management, repositories, redundant storage
when project is done, make sure everything is stored and documented such that you
can later retrace your steps and reproduce all ndings
in spirit of reproducible research data is also often published along with the paper
12
3 Color
Additional literature for this section.
E. R. Kandel, J. H. Schwartz, T. M. Jessell, S. A. Siegelbaum, and A. J. Hudspeth. Principles
of Neural Science. McGrawHill, New York, 5th edition, 2013.
[Link]
British polymath, obtained medical doctor degree from Uni Göttingen in 1796
also known for advocating the wave theory of light, introducing the early form of the
double slit experiment
Helmholtz in 1850: violet, green, red. Their relative signal strength is perceived as color.
Can increase intensity without changing hue.
[Link]
also known for: Helmholtz decomposition, equation, . . .
[Link]
some historical context:
tetrachromacy: some animals have four types of cone cells, some can see ultraviolet. ex-
ample: goldsh
13
Opponent process theory.
white vs black, green vs red, yellow vs blue
color perception based by position on these three axes, `there is no reddish green, or bluish
yellow'
[Link]
proposed by Ewald Hering in 1892, later formalized by Leo Hurvich and Dorothea Jameson
present in Goethe's discussion of color, 1810 (Goethe made accurate observations with
prisms and the like, but his interpretation was more based on aesthetics than scientic
rigor)
there is a rough equivalence of the (w-bk), (r-g), (y-b) channels in the earliest visual
processing in the retina, e.g. [Kandel et al., 2013, p. 594]
[Link]
so not in contradiction of trichromacy, latter is essentially the rst processing step of the
former
[0, 1] is usually discretized into 256 discrete values (=8bit), given as natural numbers
between 0 and 255, or as hex code: 00 to FF
14
color specication in HTML: #RRGGBB
python example:
depends on what red,green and blue are used for actual mixing. so in principle is
device dependent.
distances in the `RGB-cube' are not necessarily accurate reections of perceived sim-
ilarity by humans
attempt to nd objective descriptions of color, based on `standard observers' and `standard
illuminants'
15
lightness / value: interpolation between black,color, and white
[Link]
transformation between RGB and HSL/HSV values
note: so HSL/HSV are merely alternative parametrizations for RGB color space, so
also still a `relative' color space
is a parametrization in which certain `natural' operations are easier to express
python example:
CMYK.
subtractive color model. base colors: cyan, magenta, yellow, black (k stands for key, usually
the printing plate with most structural detail)
[Link]
CMYK is `overparametrization': CMY channels would be enough. K is used to save
expensive color ink, and to get deeper black
again device dependent, conversion to and from RGB requires some registration prole
16
Preliminaries.
in principle: space of perceivable colors is three-dimensional, could encode three dimensions
via color
but: color shading and saturation are at the bottom of the ClevelandMcGill scale (more
info later), so only qualitative presentation of data, not precise and quantitative
also: `unpacking' three dimensions from color within a 2d plot can be challenging for
viewers, due to our diculties of conceptualizing more than three dimensions
Highlighting.
use color for pop out eect
Nominal data.
need clearly distinct colors, ideally without obvious order
simple example: dierent hues for same saturation and value in HSV
17
how many categories can we visually distinguish? Kirk: at most 12 categories via hue
(p259). General advice: as few as possible, try to have at most 6.
more information can be shown better via annotation, multiple additional plots (e.g. fo-
cussing on sub-groups), interactive visualization
Ordinal data.
colors should be ordered in an intuitive way. bad example:
18
Interval or ratio data.
use color scales / color maps
warning: rainbow scale may be very confusing because opposite ends look very similar
(could be useful for cyclic data):
19
3.4 Color maps
Python example.
value variation for xed hue in HSV
two opposing hues for signed data
saturation variations
summary: in principle can easily create color maps, but they are not perceptually uniform,
do not make the most of our color perception
Perceptual uniformity.
many standard colormaps in various software is not perceptually uniform, can cause sub-
stantial perceptual `gaps'
this eect can easily be visualized with a `comb pattern' (see python examples)
matplotlib contains a few perceptually uniform ones, e.g. viridis or plasma
good resource for more perceptually uniform color maps: [Link]
rg/
20
Normalization / truncation / transformations.
Multidimensional data.
maps and vector elds: 2d to 2d
in polar coordinates:
f (x, y) cos(φ(x, y))
= r(x, y) ·
g(x, y) sin(φ(x, y))
can in principle be represented by color function. For example: use φ as hue (scale [0, 2π]
to [0, 1]), use scaled r as value (need to truncate at some maximum value)
21
matplotlib viridis seems to be fairly robust
22
4 Human visual system and cognition
Literature for this section.
Christopher Healey. Perception in visualization. URL [Link]
healey/PP/.
Christopher Healey and James Enns. Attention and visual memory in visualization and computer
graphics. IEEE Transactions on Visualization and Computer Graphics, 18(7):11701188, 2012.
doi:10.1109/TVCG.2011.127.
Jeremy M. Wolfe, Melissa L.-H. Võ, Karla K. Evans, and Michelle R. Greene. Visual search
in scenes involves selective and nonselective pathways. Trends in Cognitive Sciences, 15(2):
7784, 2011. doi:10.1016/[Link].2010.12.001.
See also [Cairo, 2013, Part II], [Spence, 2014, Chapter 4], [Kandel et al., 2013, Chapters 25-28].
An unsatisfying description of the eye and brain: What is the meaning of the small picture
drawn in the brain? How do we process and interpret an image in the brain?
A digital camera as metaphor for the visual system. Eye and retina are lens and ccd chip,
nerves are the wires, brain are processor and hard drive. But the retina is a very peculiar
ccd chip, how is the signal processed in the brain?
23
[Link]
Photoreceptors.
rods
7mio, three types with peak sensitivity in at dierent wavelengths: long, medium,
short ⇒ color detection
small part of electromagnetic spectrum can be perceived by the eye
[Link]
24
distribution of cones and rods
rods relatively evenly distributed, density gradually decreasing towards the periphery,
two notable gaps.
fovea: contains highest density of cones, responsible for sharp color vision
but due to higher sensitivity of rods: at night fovea is not so helpful. astronomers
know: look slightly past a star to see it
blind spot: optimal nerve leaves retina, neigher cones nor rods
[Link]
black layer of pigments at the back to avoid re-scattering of light into eye
interesting: Receptors are behind the two processing layers. Whether this is on purpose or
by accident is not fully known. In fovea the front layers are pushed aside.
⇒ blind spot is necessary consequence of layer ordering: optic nerve must pass through
retina to brain
25
transient cells for better detection of temporal variations: higher ring rate on increase
of signal, then reduce again (act like a temporal edge detector)
only 10% of cortical neurons driven by color contrast rather than luminance contrast
A simple experiment: close your eyes for a while, open them again and keep them focused
on xed object. While keeping the eyes xed, it is extremely dicult to properly see objects
beyond the `central focus of vision', and to determine their color.
a sequence of xations (lasting typially around 200ms) and quick saccades in between
( 20ms) where the eye moves
location of next saccade mostly chosen unconciously / automatically, based on input
from peripheral vision (bottom-up) and task/context (top-down)
evolutionary trait, important for survival
moving and uncommon objects attract our attention
26
simple example of a deduced design principle for animations: do not start an animation
and simultaneously introduce new text box
[Link]
[Link]
Kundel and Nodine, 1975: trained radiologists were shown lung X-rays for 200ms. Could
detect anomalies in 70% of cases (97% under unlimited viewing).
Conclusion: we extract a lot of information from an image in the rst 200ms, before we
can even consciously think about the image.
This is called preattentive processing. The name refers to processing that happens approxi-
mately within rst 200ms after stimulation, on large multi-element displays. Eye movement
takes about 200ms, so this processing happens before eyes can focus on something, and
must therefore happen in parallel in the low-level visual system.
Motivated by `edge detection' neurons in the brains of cats (cf. the famous experiment by
David H. Hubel and Torsten Wiesel in 1959, 1981 Nobel prize in medicine)
27
Treisman designed experiments with two dierent performance measures:
Time experiment: Subject must complete a task as fast as possible, while being
accurate. THen increase number of distractors. If solving time is approximately
constant, then task is preattentive. Otherwise, serial search is required and it takes
longer with increasing number of distractors.
Accuracy experiment: A xed short time (250ms) to solve the task is given. The eye
cannot move in this time. Measure accuracy vs complexity. If accuracy remains high
with increasing complexity, task is preattentive.
length
closure
size
curvature
density
number
hue
luminance
intersections
terminators
3d depth
28
features in preattentive processing [Healey]
boundary detection: detect a boundary between two groups of elements, where all of the
elements in each group have a common visual property
region tracking: track one or more elements with a unique visual feature as they move in
time and space
Conjunction search.
nd target with several specic features (e.g. hue and shape) that are not unique. typically
much harder, does usually not happen preattentively.
29
conjunction search is much harder [Wolfe]
Feature hierarchy.
`hue trumps shape' (caveat: color deciency): pop-out eect of some feature may over-
shadow `weaker features'
Ensemble coding.
humans are good at getting overall impressions at rst glance. examples:
30
`average emotion' in group of faces
`setting' of a scene (e.g. kitchen)
the overall impression might help to perform target search faster, e.g. bread in kitchen.
this suggests that there are several parallel processing pathways in the brain.
proximity
similarity
connectedness
31
continuity
closure
symmetry
[Link]
each feature has its own map: where in the image does this feature occur
of course: reality not as simple; perception is not as binary; sometimes even conjunction
search can be preattentive
32
Other theoretical models.
texton theory: things that look distinct in isolation can look almost identical in crowded
arrangements
feature maps: bottom-up; search query: top-down; queries are in format/features provided
by the visual cortex;
also explains why pure bottom-up attempt to predict location of next saccade failed
(saliency theory: Itti and Koch, `Computational Modeling of Visual Attention', Nature
Rev.: Neuroscience, 2001)
⇒ preattentive is not entirely independent of attention (recall bread and kitchen example)
Postattentive search.
Does looking at scene for longer time quickly improve our understanding?
This is true when we can link objects in the image to familiar representations from long-
term memory (LTM). LTM can be queried almost instantaneously.
33
This is conrmed by a simple experiment: target search for arbitrary conjunction of features
(e.g. `green vertical') among several objects. iIn this case, showing the image for 300ms prior
to showing the target description did not speed up the search.
But again: reality more complicated. Sometimes there is a positive eect (keyword `con-
textual cuing').
Our takeaway: if a visualization looks unfamiliar and is not accessible via preattentive
processing, then it will take a long time and mental eort to parse and understand.
Change blindness.
the photography metaphor from above is inaccurate: it is not true that an increasingly
accurate and faithful model of the scene is built in brain over time as the image is gradually
processed in greater detail. only short-lived models specically guided by the current vision
task are created.
good experiment: change blindness. if two similar images are shown next to each other (or
separated by a short blink) then we may sometimes not spot the dierence, even when it
is not particularly small or subtle
obviously our visual system detects the change in the pictures, but our attention is not
drawn to it
some theories:
overwriting. new image overwrites old image, everything that is not saved via ab-
straction is lost. but: we would immediately see change if no blink in between (have
time dierence lters in visual cortex, these are tricked by the blink)
rst impression. abstraction: we do not encode scene as accurate pixel rasterized
image, but more like a naive, abtract vector graphic (`elderly couple in front of sphinx
statue, trees in background'). if change in image does not require change in this
encoding, it is not noticed. example: experiment with movie actor changed mid-lm.
everything stored, but not compared: illustrated by experiment. subject is asked
for directions by person with basketball. students show up, cause some distraction,
basketball disappears. only few individuals notice that it is suddenly missing, but
more half of the others remember the ball afterwards.
Inattentional blindness.
if our attention is drawn onto a specic task, other things may be missed, even if they are
obvious
simple example: individuals had to examine a cross on slide and see which arm was longer.
after two or three trials, a small `critical object' was added to the image. 25% of subjects
missed this; but essentially 100% noticed the object when asked to look out for it
34
Attentional blink.
subject looks at sequence of images, approx 100ms per image, need to judge if target was
present or not, by pressing some button
when pre-attentive processing has identied relevant candidate (and thus `activates' con-
scious processing), the pre-attentive processing is disabled for a short interval
our vision seems to provide some specic fast low-level info extraction mechanisms, that
can then be used to solve a specic set of high-level tasks, the latter probably selected by
evolution
Preattentive processing.
obvious application in data-feature mapping, i.e. when mapping data attributes to visual
features;
if used properly, we can automatically detect distinct trends in dataset, identify `outliers'
so re-use visualization techniques that the reader already knows, e.g. small multiple, smooth
animations
35
Attention management.
make sure that viewers know what to focus on, they may miss important things when
focussing on wrong parts of image
attention is limited in space and time, do not ask for too much at once
Abstraction.
since internal representation of gure in brain seems to drop many `unnecessary details'
(see change blindness), strong abstraction must happen in visual understanding of scene
36
5 Graph visualization
5.1 Graph layout problem
Some of the previous embedding methods can be seen as graph layout algorithms.
The graph layout problem is as follows: Given an abstract graph without vertex positions,
nd good vertex positions for visualization of the graph.
A related problem is manifold learning: In that case vertex positions are given, but lie in
a high-dimensional space. Then we need to nd a low-dimensional embedding.
Layout algorithms usually work by minimizing some form of loss / objective function. The
best loss will depend on the context. Typical criteria are:
Force based embeddings: Vertices are modeled as `repelling charges' that want to be far
form each other, edges act like springs that draw vertices together (or that have a preferred
length). Then the `energy' of the embedding is minimized with respect to the positions.
A graph can have multiple intrinsic length scales. It may look like a one-dimensional
manifold at one scale, but 2-dimensional at a smaller scale. At the microscopic scale it will
just look like individual points. Parameter choices will aect which version we see.
Spectral methods give globally optimal results (PCA, MDS, Diusion maps), but they are
restricted to particular cases (e.g. linear projection of Euclidean distances in PCA). Much
more general losses and embedding classes to minimize over can be conceived, but then
one can typically no longer guarantee global optimality.
37
5.2 Decorated graphs
Graphs considered so far were large but relatively simple in the following sense:
Vertices were simple points, sometimes with a simple class label. No complex properties.
Likewise, edges merely represented similarity or proximity between vertices.
Drawing them with simple markers (maybe decorated by color and size) and lines was sucient.
Of course there are more complex graphs where vertices and edges have more structure and
properties:
Vertices have an `identity': may represent persons, agents, classes, proteins, electronic
devices, . . .
Edges describe nuanced interactions: administrative relation (supervisor, . . . ), class rela-
tions (derivation, aggregation, . . . ), biochemical pathways, . . .
These additional attributes can be encoded visually in various ways.
Vertices become boxes, with labels and text, dierent shapes, . . .
Edges have dierent line styles, arrow tips, text, . . .
5.3 Examples
Some examples were given in the Python notebooks. Here are more examples from dierent
applications.
Software.
Graph layout documentation in Mathematica
[Link]
Manifold learning implemented by scikit-learn
[Link]
Biochemistry.
Biochemical pathways
[Link]
show
Cytoscape
[Link] [Link]
Waddington ot
[Link]
38
Meshes, diusion, and learning.
Intrinsic meshes and their properties
Sharp, Gillespie, Crane: Geometry Processing with Intrinsic Triangulations, ACM SIG-
GRAPH 2021 courses, 2021
Deep learning for meshes and point clouds via the Laplacian
Sharp, Attaiki, Crane, Ovsjanikov: DiusionNet: Discretization Agnostic Learning on
Surfaces, ACM Trans. Graph., 2022
Social networks.
UML.
Graphical models.
Pictorial representation of structured high-dimensional probability distributions. Graphs
encode dependency information.
Feynman diagram.
Pictorial representation of interacting elementary particles
39
6 Edward Tufte and minimalism
6.1 Introduction
Edward Tufte (1942-).
Professor emeritus for political science, statistics and computer science at Yale University.
First inuential book data visualization: The Visual Display of Quantitative Information,
1983, Tufte [1983]
Uses very polemic language in his books, seems to enjoy deconstruction of bad examples,
likes to formulate lists principles.
The following section is based on Tufte [1983], examples taken from there, and other
material inspired by this book.
induce the viewer to think about the substance rather than about methodology, graphic
design, the technology of graphic production, or something else
reveal the data at several levels of detail, from broad overview to the ne structure
be closely integrated with the statistical and verbal descriptions of the data set.
6.2 Data-ink
Source for this section: [Tufte, 1983, Chapter 4].
40
Example: Evolution of charts by Playfair.
rst example: 1785, early pages of `The Commercial and Political Atlas'
second example: created on year later, already much more mature, removed much of the
`background'
Tufte formulates a fundamental principle: Above all else show the data.
Denition.
data-ink is the ink in a graphic that represents data / information
non-data-ink: frames, grids, (unnecessary) ticks, decoration
data-ink: data points, (necessary) labels, derived data (e.g. marginal distributions,
indication of minimal or maximal values)
data-ink
data-ink ratio =
total ink
Example: electroencephalogram.
extreme example: almost exclusively data-ink, but can only be read by specialists
41
Example: sour taste.
original image taken from: Kuznicki and McCutcheon: Cross-enhancement of the sour
taste on single human taste papillae. Journal of Experimental Psychology: General, 108(1),
6889, 1979. (study eect of sucrose on the perceived intensity of sour taste)
Tufte's introduction in book: `[The display] compares each long bar with the adjacent short
bar to show the viewer that, under the various experimental conditions, the long bar is
longer.'
Tufte removes: frames, some ticks and labels, one side of each bar, stars (marking the
longer bars), text decoration (underline)
lines connecting adjacent bars are kept (data, since they show which experiments belong
together)
Tufte: conventional box plot is highly redundant. Suggests minimalistic version, argues
via number of placings of straightedge
(information about) data is there; but weight of ink does not align with weight of data
(usually higher density within quartiles, otherwise not proper plotting device anyway)
Tufte frequently makes data density calculations: how much numbers are encoded in
a gure and equates this with amount of numbers that are transferred into viewers
brain
42
but the visual system/brain do not extract a list of numbers from a graphic (at least
not at "rst glance"), but coarse structures and trends
coarse structure more accurately visually reected by original design
original image created by science illustrator Roger Hayward for chemistry textbook by
Linus Pauling, 1947 (introduced covalent bond in chemistry, two Nobel prices, chemistry
and peace)
remove grid, try removing guidelines (but rather not), add individual labels
Conclusion.
According to Tufte good gures have a high data-ink ratio.
But minimizing data-ink should be seen as a loose guideline, not a rigorous principle.
Tufte's suggestion on data ink is not based on scientic studies but more on personal
preferences.
43
Ducks.
a duck is a graphic which is just entirely decoration, e.g. self-promotion of graphical tech-
niques instead of information display
[Link]
Dumbing down.
common misconception: graphics are for `dumbing down' data, ashy presentation of `bor-
ing statistics'
when struggling to design an interpretable gure, reex is to merely simplify the data
instead of working harder
Of course this is true. But also keep in mind: readers/listeners need time to absorb, process,
pause and digest new information. Not all required background-knowledge may be present
(or has become a little diuse). We get tired. Human brains are not computers, eyes are
not cameras. Motivation, patience, redundancy and good graphics are key to including the
audience.
44
Nigel Holmes was art director for Time magazine
`anti-Tufte': very low data-ink ratio, data-density, full of decoration and `chart junk', (and
blatantly sexist)
However:
Tufte's principles are not rigorously based on scientic research but also on aesthetic pref-
erences
there is no empirical evidence that data-ink ratio is indeed a good measure for the quality
of a graphic (in terms of readability)
Ben-Gurion University, 2007, 87 students: compare bar charts with minimalistic ver-
sions.
No signicant dierence in interpretation performance;
students aesthetically preferred `classical' charts.
University of Saskatchewan (Canada), 2010, 20 students: compare four Nigel Holmes
illustrations with minimalistic versions.
Subjects interpreted both versions equally well.
After a waiting period, subjects could answer questions about Holme's graphics with
higher accuracy (were not told that they would be questioned)
these are not conclusive, representative studies (e.g. very small sample groups) but
tempting naive conclusion: decoration may help the brain remember a graphic (and
thus also its data)
45
7 How to lie with charts
This section follows roughly the book [Cairo, 2019] with most examples are taken from
there. Some examples are taken from [Tufte, 1983].
Cairo identies several ways that charts may lie to us:
by being poorly designed
by displaying dubious data
by displaying insucient or inappropriate data
in the way uncertainty is treated
by suggesting misleading patterns
by pandering to our expectations and prejudices
DISCLAIMER: The data and charts shown in this section are often ctional and have
not been veried by me. Due to the sheer mass of examples not each example can be
discussed in detail. The examples should therefore not be misinterpreted as `sources' on
the respective topics but merely as illustrations for certain misrepresentations of data and
relations. The list given in this section is by no means exhaustive.
46
example [Tufte, 1983]: fuel economy, miles per gallon requirements
Inconsistent design.
example [Tufte, 1983]: nobel prices (left: original version, right: xed version)
number of nobel prizes per decade is shown, but last data point is only over four years
Distorting 3d eects.
example [Tufte, 1983]: oil prices
47
Why it matters?
taken from [Cairo, 2019]
study on the deceptiveness of deceptive graphics: Anshul Vikram Pandey et al.: `How
Deceptive Are Deceptive Visualizations? An Empirical Analysis of Common Distortion
Techniques', New York University Public Law and Legal Theory Working Papers 504 (2015)
charts comparing the drinking water supply situation in two ctional cities
subjects were shown representative or skewed versions, all charts in addition contained the
correct numbers
subjects were subsequently asked to rate the severity of the dierences between the two
cities
subjects with wrong chart versions were substantially misled, eect weaker in more edu-
cated subjects, but they were also misled
48
similar example [Cairo, 2019]: what is appropriate vertical scale for national debt?
starting at zero may not be necessary if numbers are not encoded by length (bar chart)
but by position (scatter / line plot)
but need to make sure that readers are not misled (e.g. do not draw axis at non-zero value,
additional hint in caption)
Aspect ratio.
changing the aspect ratio of a graphic can change its perception
Logarithmic scale.
sometimes non-linear scales of the axes are more appropriate
49
7.2 Dubious data
Ination.
adjust monetary values for ination, possibly for purchasing power parity
example [Tufte, 1983]: budget increase (contains also several design aws, and does not
correct for increase of population)
example [Tufte, 1983]: Playfair (has also published a chart on the increase of the national
debt, in nominal currency and with dramatic portrait format, but has included also a
`de-sensationalized' landscape format version with inated-adjusted numbers)
Faulty data.
the displayed data can simply be wrong / contains glitches that were not noticed
example [Cairo, 2019]: pornhub (pornhub published statistics about access numbers in
various states of the US based on IP addresses. Kansas was a strong outlier. Actual
explanation is not immense porn consumption in Kansas, but that IP addresses that were
assigned to US, but not to a federal state, were incorrectly assigned to Kansas)
50
data, not representative for each country, entirely dierent source. So hard to compare the
numbers.)
example [Cairo, 2019]: Barclays gender pay gap (BBC: `women earn up to 43% less than
men at Barclays'. Impression: dierence due to unequal pay for similar positions. more
detailed data: dierence due to much fewer women in senior and management positions.
So still a stark inequality, but must be addressed very dierently.)
51
Absolute numbers vs ratios and conditional probabilities.
example [Cairo, 2019]: vaccination (ctitious example, inspired by reality): more children
dying due to the vaccine than due to smallpox. but: ignores total number of vaccinated
or non-vaccinated children. conditional probability for death among vaccinated children is
much lower than among un-vaccinated children.
example [Cairo, 2019]: Charleston church shooting 2015 (Shooter was partially motivated
by statistics of `black-on-white crime'. Chart made it look as if black violent oenders were
specically targeting white people. This ignores the composition of the general population.
See python example.)
52
example: unemployment rate (4.3% to 4.4% in one month means almost nothing. it is
mostly noise. look at longer time-frame to see signal. similar: daily corona virus infection
numbers)
on the country level the two seem to be negatively correlated. but: cannot infer causal
relation.
maybe confounding factor: inequality
at the individual level the correlation may even be reversed in countries with high
inequality
53
population fallacy.
example [Cairo, 2019]: cigarettes vs life expectancy (trend at the country level seems like
a positive correlation, because wealth may be a confounding factor. at the individual level
we recover well-established negative correlation)
Simpson's paradox.
example: kidney stones ([Link]
7.6 Epilogue
For chart creators: Tufte's principles of graphical integrity.
The representation of numbers, as physically measured on the surface of the graphic itself,
should be directly proportional to the numerical quantities represented.
Clear, detailed, and thorough labeling should be used to defeat graphical distortion and
ambiguity. Write out explanations of the data on the graphic itself. Label important events
in the data.
The number of information-carrying (variable) dimensions depicted should not exceed the
number of dimensions in the data.
54
For chart consumers: Cairo's principles.
With the internet we consume a lot of charts from a wide range of sources, often not professional
or acting in good faith, and often without sucient context. It is impossible to scrutinize every
chart that we see. But we should be wary. Cairo gives some advice [Cairo, end of Chapter 3,
subset of full list]:
Don't trust any chart built or shared by a source you're not familiar with until you can vet
either the chart or the source, or both.
Don't trust chart authors and publishers who don't mention the sources of their data or
who don't link directly to them. Transparency is another sign of appropriate standards.
Expose yourself to sources you disagree with, and assume good faith on their part.
Don't assume ill intentions when haste, sloppiness, or ignorance is the more likely expla-
nation for a bad chart.
But trust has its limits. If you begin spotting a pattern of misdeed in a source on your list,
erase it.
Follow only sources that issue corrections when they ought to and that do it visibly.
All journalists have political views. Who doesn't? But most try to curb them, and they
do their best to convey, as famed Watergate reporter Carl Bernstein likes to say, `the best
obtainable version of the truth.'
Telling the dierence between a merely partisan source, there are reliable ones all over
the ideological spectrum, and a hyperpartisan one can be tricky. It will require some
time and eort on your part, but there is a very good clue you can begin with: the
tone of the source's messages, including whether that source employs ideologically loaded,
bombastic, or aggressive language. If it does, stop paying attention to it, even if it's just
for entertainment.
Expertise matters, but it's also specic. When it comes to arguing over a chart about
immigration, your judgment as a layperson is as valid as that of a mechanical engineer or
someone with a PhD in physics or philosophy. And your opinion is less likely to be accurate
than are the ones expressed by statisticians, social scientists, or attorneys who specialize
in immigration. Embrace intellectual modesty.
It's easy to be overly critical of charts that depict realities we'd rather not learn about. It's
much harder to read those charts, to assume that their creators likely acted in good faith,
and then to coolly assess whether what the charts show has merit. Don't immediately snap
to judgment against a chart just because you dislike its designers or their ideology.
Conversely: The more ideologically aligned you are with a publication, the more you should
force yourself to read whatever it publishes with a critical eye. We humans nd comfort in
charts and stories that corroborate what we already believe and react negatively against
those that refute it.
55
Reasoning and rationalization.
Some points from the epilogue in Cairo's book.
We are prone to lying to ourselves, to all sorts of logical fallacies and mental biases.
`Forming beliefs is easy; changing them is hard work.' (from `The Believing Brain' by
psychologist Michael Shermer)
example of cheating students (from `Mistakes Were Made (but Not by Me)' by Carol Tavris
and Elliot Aronson):
start with two students, initially with mild opinions about cheating
one day, during exam, both are tempted to cheat. one goes through with it, the other one
not.
the one who resisted will likely become more self-righteous about not cheating
the other may start to say cheating is not that bad, or it was justied in this case, because
the exam was unfair, everyone does it, etc. (I'm a good person, so it's impossible that
cheating is really that bad!)
rationalization is the habit of `defending' views/beliefs we already hold, even against new
evidence. we are very prone to it.
56
8 Animations and interactive visualization
8.1 Motivation
seen in previous chapters: compressing high-dimensional data into graphics is considerable
challenge
time oers an additional dimension
one additional dimension can often be accessed by a pre-dened animation
even more dimensions accessible via interaction
Saccadic blindness.
recall: eye movement composed of xations (≈ 200ms) and fast saccades between them (≈
20ms)
during saccade we are blind, if we quickly move gaze from one part of room to another, we
do not see scene continuously moving by
intuitively clear: our visual designs should reduce number of saccades
57
interpretation:
Moving RSVP.
dierent presentation modes:
collage
shot
oat (with brief `capture' of pictures near center)
experimental comparison (Corsato at al., An eye tracking approach to image search activ-
ities using RSVP display techniques. ACM Proceedings of conference on advanced visual
interfaces, 2008)
Visual momentum.
Spence, Section 5.3.8; Woods: `Visual Momentum: A Concept to Improve the Cognitive
Coupling of Person and Computer', International Journal of Man-Machine Studies 1984
examples:
58
Some implications for animations.
When viewers cannot control playback (e.g. in talk), show animation in loop or at least
several runs. Before understanding content of video, viwers need to decode it and learn its
visual language.
When animation is running, let viewers watch, do not compete for attention. In short clips
it is often possible to explain what they are supposed to see before, or maybe after a rst
run (→ recall attentional blindness).
Choose suitable playback speed. Keep in mind: viewers usually see video for the rst time.
Leave extra time when you explain things during the video.
When an animation shows temporal evolution over time, do not immediately cut away
after last time-step. Give viewers time to study the nal state.
how to design common devices? door handles, coee makers, bicycle brakes
Design principles.
aordance, perceived and actual
metaphors in graphical user interface: exploit familiarity of users with other concepts for
fast adaptation
feedback, examples:
59
constraints
consistency
Context.
thumbnails of neighbouring pages or images
60
Level of detail.
travel navigation: before digital navigation assistance, printed maps faced a dicult trade-
o:
high resolution: impossible to print for large area, would constantly need to turn
pages, dicult to get large scale impression of travel
low resolution: not enough detail within cities, and at critical junctions
digital navigation can store all high resolution information, automatically track loca-
tion on map, and choose zoom level based on appropriate level of detail
engineering drawing: distinguish between full details for all parts, and reduced version that
explains how to replace a certain part
Hierarchies.
example: hyperbolic graph browser. Better than `regular zoom' since it still provides
context.
Directories and lenames themselves are a means of visualization of data. With proper
use we can eortlessly remember (or at least retrieve) the locations of thousands of
les.
list vs items vs thumbnails
Multiple instances of same interface might be required at same time. They can be organized
in tabs or oating windows.
much smaller screen, touch screen much coarser than mouse, no keyboard, only `back
button'
navigation often only in `tree graph', cumbersome for complex applications
recall example: Deutsche Bahn navigator app
on laptops: mouse less precise
61
8.5 Sensitivity and dynamic exploration
Extend mental model of users.
user should quickly be able to extend their mental model to include expectations to reac-
tions on changing parameters
so ideally: from current point can glimpse a little bit into all directions
Sensitivity data.
how did parameter change aect change of outcome?
anticipate if a small parameter change can lead to a desired outcome? show `near misses'
Dynamic exploration.
short-cut in action cycle, get immediate feedback
PlotLy.
very interactive even in default mode
core library implemented in JavaScript, hence simple export of dynamic gures as HTML
code not yet stable/persistent, subjective: deviating a little from give examples with short
code usually requires a lot more code
animation
feels outdated, essentially works like old-school GUI implementation, substantial boilerplate
code
62
Manim: animations.
script-based creation of animations in python
echarts
[Link]
[Link]
[Link]
nice example gallery: `open data show room' of Uni Bern, Institut für Wirtschaftsinformatik
(German only, unfortunately), [Link]
warning: this also contains quite a few ducks in Tufte's sense, e.g. [Link]
[Link]/#
PlotLy / Altair
for PlotLy see above, Altair is similar
Tensorow Playground.
[Link]
how is the whole content broken down into individual documents? what is the hier-
archical structure of documents?
63
how is this structure presented to the user? how can users navigate it? (only moving
in the tree, use search function, many internal hyperlinks)
how complex is each choice? how many choices necessary? when looking for a leaf
node, are the names of the parent nodes clear?
categories can be claried by keywords: `look ahead information' (`residue', Furnas:
Eective view navigation, ACM proceedings of CHI'97, 1997)
often supplied by `back' button in browser, but in interactive sessions often in conict
with website functionality (re-sending of requests?)
Dark patterns.
In a perfect world the design of websites would be optimizes for user experience. In practice
they are often designed to encourage the best outcome for the company that runs the
website. When website (or generally application) design intends to bias the user against
acting in their best interest this is referred to as a `dark pattern'.
example: accepting the default privacy settings (which are very open) is much easier (and
encouraged by suggestive link coloring) than choosing a more restrictive setting
example: it is sometimes very easy to start a subscription for a service with very few steps
that are easy to follow, whereas cancellation may be only possible via much more subtle
paths, including articial obstacles (possibly not being possible online at all)
64
Misrepresentation of data through charts and graphs can lead to misinformation by employing techniques such as poor design, skewed encoding, and inappropriate scaling. Examples include inconsistent graphical representations, distortions through 3D effects, and altered aspect ratios that exaggerate or minimize data differences. Such practices can mislead audiences by suggesting incorrect patterns or hiding critical information, as seen in studies where altered representations misled viewers about the severity or nature of differences in data sets . Care must be taken to ensure the accurate depiction of data, including proper labeling and appropriate context, to avoid misleading interpretations .
Rods and cones in the human retina play distinct roles in vision; rods are abundant with approximately 100 million present, and they are highly sensitive to light, capable of functioning in low-light conditions (dominant in the dark) but provide less spatial resolution. Cones, numbering around 7 million, detect color and operate best in bright light, contributing to high-acuity color vision. The distribution is such that cones are concentrated in the fovea, enabling sharp central vision, while rods are spread across the retina, aiding in peripheral and night vision . This arrangement allows humans to see a range of colors and adapt to varying light conditions .
Aspect ratios and axes scaling can significantly affect the perception of trends and differences in charts. Altering the aspect ratio can exaggerate or minimize trends, potentially misleading viewers. Axes not starting from zero can provide a distorted view of data changes unless clearly indicated and justified by the context of the data, as in cases with non-linear scales (e.g., log scales for exponential data). Misleading scaling practices can distort data representation, leading to incorrect interpretations by readers who may not critically evaluate the axes and scales used . Transparency in representing data with appropriate scales is crucial to maintaining accuracy .
The debate between Edward Tufte and Nigel Holmes centers around the use of aesthetics versus functionality in data visualization. Tufte advocates for minimalism, emphasizing high data-ink ratios and clarity without unnecessary embellishments. Holmes, in contrast, uses decorations and vibrant visuals, often seen as 'chart junk,' to enhance engagement and memorability. Studies suggest that while Tufte's approach emphasizes accuracy and readability, Holmes' style can make graphics more memorable and engaging, though not necessarily impacting comprehension negatively. This debate underscores the balance between making graphics aesthetically pleasing yet functional and informative .
Preattentive processing is crucial in data visualization because it allows viewers to extract essential information from images within milliseconds, before conscious attention is fully engaged. This rapid processing helps identify critical elements like colors, shapes, and movement without the need for focused attention, thereby guiding the design of visualizations to effectively communicate key messages quickly . Understanding preattentive processing can lead to improved visualizations by aligning them with how human visual systems naturally and efficiently process visual information .
The trichromacy theory, developed by Young and Helmholtz, explains color perception based on the presence of three types of photoreceptors sensitive to violet, green, and red; these receptors detect colors based on different signal intensities without altering hues . In contrast, the opponent process theory, proposed by Ewald Hering, suggests that color perception is based on opposing pairs of colors (white-black, green-red, yellow-blue), and that the perception of one color in a pair suppresses the other, accounting for phenomena like the absence of reddish-green or bluish-yellow . These theories complement each other as trichromacy is considered the initial processing step, while opponent processes reflect further processing stages .
To ensure reproducible research practices in data visualization projects, key steps include using version management systems, maintaining repositories, ensuring redundant storage, and backing up data. Once the project is completed, all findings and processing steps should be thoroughly documented and archived to allow future retracing and reproduction of results. This practice aligns with the spirit of reproducible research, wherein data and processes are frequently published alongside the main paper .
Interpreting graphical data with inflation-adjusted values can be challenging due to potential misrepresentation of data trends over time if inflation adjustments are not appropriately applied. Inflation-adjusted figures are crucial for accurate longitudinal comparisons, yet incorrect adjustments can lead to misleading insights, as exemplified by charts that fail to correct for inflation when displaying economic trends like oil prices or budget increases . Properly adjusting and clearly indicating these changes is essential for clarity and to avoid distorting the real economic conditions depicted in the data .
Eye-tracking research provides insights into how individuals engage with and interpret visual information, highlighting the role of fixations and saccades in visual attention. This research reveals patterns in how viewers process information, suggesting that attention is both bottom-up (driven by visual input) and top-down (guided by tasks or expectations). Eye-tracking studies have shown that moving and important objects attract more attention, influencing the design of animations and interactive elements in visualizations to align with natural attention patterns . Understanding these dynamics helps inform the design of data visualizations to optimize the user's visual comprehension and retention .
Color deficiency can significantly impact data visualization, as individuals with color vision deficiencies may struggle to distinguish between certain colors that are easily discernible to others. For example, palettes that rely heavily on red and green can be problematic for people with red-green color blindness. Thus, it is essential to choose color schemes that are robust to these differences, such as the use of color palettes like matplotlib viridis, which are designed to be more accessible. Simulation tools can help designers assess how visualizations appear to those with color deficiencies, ensuring that visual information remains accessible to wider audiences .