introduction to data visualization · decide on what your visualization should convey the style and...

40
Introduction to Data Visualization Morine Amutorine Benjamin Akera Elaine Nsoesie

Upload: others

Post on 27-Aug-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Introduction to Data Visualization · Decide on what your visualization should convey The style and structure of your visualization will depend on its purpose 1 Tell a good story

Introduction to Data Visualization Morine Amutorine Benjamin AkeraElaine Nsoesie

Page 2: Introduction to Data Visualization · Decide on what your visualization should convey The style and structure of your visualization will depend on its purpose 1 Tell a good story

Instructor introductions …

Contacts:

Morine - [email protected] / Twitter: @M_moryn

Elaine - [email protected] / Twitter: @ensoesie

Ben - [email protected]

Page 3: Introduction to Data Visualization · Decide on what your visualization should convey The style and structure of your visualization will depend on its purpose 1 Tell a good story

Resources

Github Repohttps://github.com/ensoesie/DSA_Visualization

Google Trendshttps://trends.google.com

Twitterhttps://developer.twitter.com

Page 4: Introduction to Data Visualization · Decide on what your visualization should convey The style and structure of your visualization will depend on its purpose 1 Tell a good story

Why visualize data?A picture is worth a thousand words

It is easier to remember pictures than text

Useful for understanding data

Can summarize large amounts of complex data

Page 5: Introduction to Data Visualization · Decide on what your visualization should convey The style and structure of your visualization will depend on its purpose 1 Tell a good story

Visualization in Data Science can be used to:

- Explore data- Analyze data - Communicate findings - Quickly draw attention to key messages

Page 6: Introduction to Data Visualization · Decide on what your visualization should convey The style and structure of your visualization will depend on its purpose 1 Tell a good story

How to use visualizations to

communicate effectively?

Page 7: Introduction to Data Visualization · Decide on what your visualization should convey The style and structure of your visualization will depend on its purpose 1 Tell a good story

Decide on what your visualization should convey

The style and structure of your visualization will depend on its purpose

1

Tell a good story with a clear message

Design for a specific audience

FOCUS ON THE DATA

Page 8: Introduction to Data Visualization · Decide on what your visualization should convey The style and structure of your visualization will depend on its purpose 1 Tell a good story

Use color and size to highlight and suppress information

2

Page 9: Introduction to Data Visualization · Decide on what your visualization should convey The style and structure of your visualization will depend on its purpose 1 Tell a good story
Page 10: Introduction to Data Visualization · Decide on what your visualization should convey The style and structure of your visualization will depend on its purpose 1 Tell a good story
Page 11: Introduction to Data Visualization · Decide on what your visualization should convey The style and structure of your visualization will depend on its purpose 1 Tell a good story

https://venngage.com/blog/how-to-pick-colors/

Page 12: Introduction to Data Visualization · Decide on what your visualization should convey The style and structure of your visualization will depend on its purpose 1 Tell a good story

Use length and position to express quantitative information. Use color for categorical information

3

Scatter plots and bar charts allow for more accurate comparison of information over time compared to pie charts

Page 13: Introduction to Data Visualization · Decide on what your visualization should convey The style and structure of your visualization will depend on its purpose 1 Tell a good story

Think carefully about color selection and usage

4

https://africaindata.org/#/3

Use color to create groupings

Add a single color to a black and white image

Use black and white to add contrast to an image with a single color gradient

Page 14: Introduction to Data Visualization · Decide on what your visualization should convey The style and structure of your visualization will depend on its purpose 1 Tell a good story

Think carefully about color selection and usage

4

Some colors have pre-established meanings

Consider those with color blindness

Red

Stop

Dangerous

Hot

Green

Moving

Money

Plants

Blue

Water

Cool

Safe

Page 15: Introduction to Data Visualization · Decide on what your visualization should convey The style and structure of your visualization will depend on its purpose 1 Tell a good story

Use all available space and proper scales

5

Scale does not always have to include zero

Optimize the ratio between plot objects to capture accurate relationships

Transform data to a different scale e.g. use log scale to show percentage change over time

Page 16: Introduction to Data Visualization · Decide on what your visualization should convey The style and structure of your visualization will depend on its purpose 1 Tell a good story

Use text and labels to improve interpretation

6Use meaningful titles

Label axis, as needed

Add texts directly to the image - do not always rely on legends

Lines should not obstruct points

Use colors (e.g. light grey) and weight that lessen focus on tick marks and grids

https://flowingdata.com/2016/05/17/the-changing-american-diet/

Page 17: Introduction to Data Visualization · Decide on what your visualization should convey The style and structure of your visualization will depend on its purpose 1 Tell a good story

Balance complexity and clarity7

GapMinder (https://www.gapminder.org/tool)

Page 18: Introduction to Data Visualization · Decide on what your visualization should convey The style and structure of your visualization will depend on its purpose 1 Tell a good story

Balance complexity and clarity (infographics)

7

Templates and examples available online

Can combine visualizations from python with manual editing

Page 19: Introduction to Data Visualization · Decide on what your visualization should convey The style and structure of your visualization will depend on its purpose 1 Tell a good story

Examples

Page 20: Introduction to Data Visualization · Decide on what your visualization should convey The style and structure of your visualization will depend on its purpose 1 Tell a good story

Bubbles

GapMinder (https://www.gapminder.org/tool)

When to use?Visualize correlation/association

Page 21: Introduction to Data Visualization · Decide on what your visualization should convey The style and structure of your visualization will depend on its purpose 1 Tell a good story

- Connected scatter CorrelogramHeatmap

Scatterplot

https://python-graph-gallery.com

Page 22: Introduction to Data Visualization · Decide on what your visualization should convey The style and structure of your visualization will depend on its purpose 1 Tell a good story

Maps

When to use?Useful for spatial visualizations

Page 23: Introduction to Data Visualization · Decide on what your visualization should convey The style and structure of your visualization will depend on its purpose 1 Tell a good story
Page 24: Introduction to Data Visualization · Decide on what your visualization should convey The style and structure of your visualization will depend on its purpose 1 Tell a good story

- Maps with bubbles- Maps with pins healthmap.org

Page 25: Introduction to Data Visualization · Decide on what your visualization should convey The style and structure of your visualization will depend on its purpose 1 Tell a good story

Bar plots

How Africa Tweets. https://portland-communications.com/publications/how-africa-tweets-2018/

When to use?Useful for rankings

Page 26: Introduction to Data Visualization · Decide on what your visualization should convey The style and structure of your visualization will depend on its purpose 1 Tell a good story

- Box plotLollipop plotWord cloud

https://python-graph-gallery.com

Page 27: Introduction to Data Visualization · Decide on what your visualization should convey The style and structure of your visualization will depend on its purpose 1 Tell a good story

Area/density plots

When to use?Useful for showing evolution

Jain et al. The Digital Phenotype. Nat Biotech

Page 28: Introduction to Data Visualization · Decide on what your visualization should convey The style and structure of your visualization will depend on its purpose 1 Tell a good story

- Line plot(Stacked) area plotStream chart

Page 29: Introduction to Data Visualization · Decide on what your visualization should convey The style and structure of your visualization will depend on its purpose 1 Tell a good story

Networks

When to use?Useful for information flow

Page 30: Introduction to Data Visualization · Decide on what your visualization should convey The style and structure of your visualization will depend on its purpose 1 Tell a good story

https://vizhub.healthdata.org- Sankey diagram

Page 31: Introduction to Data Visualization · Decide on what your visualization should convey The style and structure of your visualization will depend on its purpose 1 Tell a good story

Code available from:

https://guyabel.com/post/animated-directional-chord-diagrams/

Chord diagram

Page 32: Introduction to Data Visualization · Decide on what your visualization should convey The style and structure of your visualization will depend on its purpose 1 Tell a good story

Bad visualizations

Page 33: Introduction to Data Visualization · Decide on what your visualization should convey The style and structure of your visualization will depend on its purpose 1 Tell a good story

Which of these images has issues?

Page 34: Introduction to Data Visualization · Decide on what your visualization should convey The style and structure of your visualization will depend on its purpose 1 Tell a good story

Which of these images has issues?

Page 35: Introduction to Data Visualization · Decide on what your visualization should convey The style and structure of your visualization will depend on its purpose 1 Tell a good story

What’s wrong with these images?

Page 36: Introduction to Data Visualization · Decide on what your visualization should convey The style and structure of your visualization will depend on its purpose 1 Tell a good story

Tools and Resources

Page 37: Introduction to Data Visualization · Decide on what your visualization should convey The style and structure of your visualization will depend on its purpose 1 Tell a good story

Python libraries

- Matplotlib- ggplot- Seaborn- Bokeh- Pygal

- Plotly- Geoplotlib- Gleam- Missingno- Leather

- Pydot

Page 38: Introduction to Data Visualization · Decide on what your visualization should convey The style and structure of your visualization will depend on its purpose 1 Tell a good story

https://github.com/ft-interactive/chart-doctor/tree/master/visual-vocabulary

The Chart Doctor

Page 39: Introduction to Data Visualization · Decide on what your visualization should convey The style and structure of your visualization will depend on its purpose 1 Tell a good story

Other tools

- Tableau - R ggplot2 and others- D3

Page 40: Introduction to Data Visualization · Decide on what your visualization should convey The style and structure of your visualization will depend on its purpose 1 Tell a good story

Next ... ipython tutorial