cjbrown dataviz v2.pptx [read-only]bioinformatics.org.au/winterschool/wp-content/... · source:...

Post on 01-Oct-2020

5 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

DATAVISUALSChristopher J. Brown

@bluecology

www.seascapemodels.org/dataviz

Sophisticated dataviz

Source: www.cifar.ca

Mean = 0.5SD = 2.7

Summary statistics

Data: github.com/stephlocke/datasauRus

All these datasets have the same mean, SD and correlation. 

Source: sciencebasedmedicine.org

Structure of this talk

1. Tools for dataviz2. Eleven principles for effective dataviz3. Repeat classic dataviz experiment4. Breaking the rules5. R the integrator

R code at www.seascapemodels.org

Tools for constructing dataviz

The ideal dataviz tool

•Sensible and clean defaults• Fast and convenient production of common graphics•Convenient to plot statistical models• Flexible enough to realize our creative thoughts

The ideal dataviz tool?

Photo: Rowan Trebilco

R and the Intergovernmental Panel on Climate Change

Data entry + merging

Maps

Graphs

Word processing

Analysis

Integrating tools

Interactive web content

Data entry

Data mergingMapsGraphsAnalysis

Word processing

+

Integrating tools

R is a flexible tool

• Flexibility is also it’s weakness•Hard to start•So many options to do the same thing•Steep learning curve•Often combine with other tools, e.g. Adobe Illustrator, Libre office (free), Gimp (free)

When should I use ggplot2 or base R?

Simple charts Complex charts

Use base R

Use ggplot2

Eleven principles for effective dataviz

1. Plot your data

2. Clarity not Simplicity

Image: Google Earth

2. Clarity not Simplicity

Figure: Mann et al. Geophys Research Letters

3. Dataviz are models of your interpretation

“Any visualization is a model”

Alberto Cairo 2016

Your own vision is a model

3. Dataviz are models of your interpretation

3. Dataviz are models of your interpretation

3. Dataviz are models of your interpretation

3. Dataviz are models of your interpretation

p < 0.001 for both

4. Visualise your models

4. “Superplots”

5. Length is most accurate for comparisons

Cleveland and McGill Science 1985

Length - aligned

Length

Angles

Area

Hue

Intensity

Accurate

Generic

Length is easier than volume or area

Length is easier than volume

Volumes are hard

Image: KeepCup

Length is better than angles and area

Mariani et al. 2015 Frontiers in E & E

While we’re on the topic of maps…

Brown et al. some time ago

Length is better!

Cawthorn, Baillie and Mariani 2018

6. Scaling matters

Compare these:

Source: viz.wtf

6. Scaling matters

6. Scaling matters

7. Choosing units

Source: vaccinationcouncil.org

Dea

ths pe

r 100

,000

Source: sciencebasedmedicine.org

7. Choosing units

8. Less ink is more: Dataviz from excel 2003

Less ink looks cleaner, less distracting

Minimal ink

-0.5

0.0

0.5

-2 -1 0 1 2x

y

9. Choose colours for more than just their looks

Colour scales

Cinner et al. 2016 Nature

Colour bar makes the yellow (5.8) look specialNot visible to red‐green colour blind

Colour scales

Effective use of colour scales

Colour scales: colorbrewer.org

10. >7 elements is hard to interpret

Source: huffingtonpost.com.au

Source: sciencebasedmedicine.org

11.Good data are easy to visualise

Quiz

To find the quiz use your device to navigate to: 

www.seascapemodels.org/dataviz

Breaking the rules

When a pie chart makes sense

Source: choosemyplate.gov

Sophistication helps when: Details matter

Source: Dalin et al. 2017 Nature

Being sophisticated is learning new skills

Source: Dalin et al. 2017 Nature

R the integrator

@bluecology www.seascapemodels.org/dataviz

Total number of people in the shopping centre

Change the world

The “hockey stick”

• Speaks to scientists and public

Vaccinations

Source: The Wall Street Journal

Get inspired

•The Truthful Art  by Alberto Cairo•datavizcatalogue.com•Books by Tufte•Twitter: #dataviz•WTF Visualizations: http://viz.wtf, Twitter: @WTFViz•R code on my webpage: www.seascapemodels.org•Take our next R course at UQ (Feb 2019)

Conclusion

•Aim for clarity, not simplicity or sophistication•Experiment to find the best way to view your data•Dataviz are models that aid interpretation•R can help you experiment with different models

top related