lecture 1: beautiful graphics in r trevor a. branch [email protected] beautiful graphics in r, fish554...

Download Lecture 1: Beautiful graphics in R Trevor A. Branch tbranch@uw.edu Beautiful graphics in R, FISH554 SAFS, University of Washington

If you can't read please download the document

Upload: meagan-harcrow

Post on 14-Dec-2015

215 views

Category:

Documents


1 download

TRANSCRIPT

  • Slide 1

Lecture 1: Beautiful graphics in R Trevor A. Branch [email protected] Beautiful graphics in R, FISH554 SAFS, University of Washington Slide 2 Slide 3 Slide 4 Slide 5 Source: www.phdcomics.com 7 Dec 2012 Slide 6 Project and credit Project: four complex figures, three from your data, one redrawn from Porzio et al. (more details: class website https://canvas.uw.edu/courses/881902)https://canvas.uw.edu/courses/881902 For credit, electronic submission of draft figures (10 March), presentation of your best figure in class (online 16 March, in class 17 March), submission of final figures (21 March) Slide 7 During class My aim is to ensure that all of you can produce beautiful, informative figures for your MS/PhD and scientific papers Listen to the lecture or read the handout or follow along with the PowerPoint on your computer or try out R code that I present What happens if I type this? Dont just ask me, try it yourself! Slide 8 Tufte: Principles of graphical excellence Well-designed presentation of interesting data Complex ideas communicated with clarity, precision, and efficiency Greatest number of ideas in shortest time with least ink in smallest space Nearly always multivariate Requires telling the truth about the data Slide 9 Napoleons campaign to conquer Russia Original plot by Minard (1861) Tufte (2001) The visual display of quantitative information, p. 41 Slide 10 Tufte: better graphics Lie factor and exaggeration Chartjunk Maximize data:ink ratio Erase non-data ink Increase the data density Labels on the figures Slide 11 Figure: New York Times, 9 August 1978, p. D-2 Tufte (2001) The visual display of quantitative information, p. 57-59 Slide 12 Tufte (2001) The visual display of quantitative information, p. 59 Here there are many decorations, but no lies Slide 13 Tufte (2001) The visual display of quantitative information, p. 70-71 Lie Factor 9.5 by volume 59.41978 dollar should be 2 X Washington Post, October 25, 1978, p. 1New York Times, January 27, 1981, p. D-1 Slide 14 Tufte (2001) The visual display of quantitative information, p. 66 Chartjunk and exaggeration The Graph of the Magical Parallelipipeds Inflation +103% Population +10% Slide 15 Tufte (2001) The visual display of quantitative information, p. 67 Slide 16 Tufte (2001) The visual display of quantitative information, p. 68 Slide 17 In time-series displays of money, deflated and standardized units of monetary measurement are nearly always better than nominal units Tufte (2001) The visual display of quantitative information, p. 68 Slide 18 Data density index The number of numbers plotted per cm 2 (Tufte) Figure: Uzzi et al. (2013) Atypical combinations and scientific impact. Science 342:468-472 Tufte ER (2001) The visual display of quantitative information DDI = 0.05 for Fig. 2 of Uzzi et al. (2013) High numbers are better Commonly ranges from 0.1 to >300 Slide 19 Tufte (2001) The visual display of quantitative information, p. 93-95 Slide 20 Kooi (1971) Fundamentals of electroencephalography, New York, p. 110 Tufte (2001) The visual display of quantitative information, p. 93 Slide 21 Slide 22 Tufte (2001) The visual display of quantitative information, p. 94-95Kelley & Bowen (1967) American Political Science Review, 61:371 Slide 23 Tufte (2001) The visual display of quantitative information, p. 102-105Pauling (1947) General chemistry, San Francisco, p. 64 Data-ink ratio: < 0.6Data-ink ratio: 0.9 Slide 24 Tufte (2001) The visual display of quantitative information, p. 102-105 Slide 25 1.22.2 1.32.3 CJFAS-mandated styleLabels directly on subplots Lessard et al. (2008) CJFAS 65:2269-2278 Label the figures, not the legends Slide 26 Principles of graphics design Above all else show the data Maximize the data-ink ratio Erase non-data-ink Erase redundant data-ink Revise and edit Tufte (2001) The visual display of quantitative information, p. 105 Slide 27 Tufte (2001) The visual display of quantitative information, p. 102Kuznicki & McCutcheon (1979) Journal of Experimental Psychology: General, 108:76 Barplots 1 Slide 28 Tufte (2001) The visual display of quantitative information, p. 126-128 Barplots 2 Slide 29 Tufte (2001) The visual display of quantitative information, p. 126-128 Erase the box Slide 30 Tufte (2001) The visual display of quantitative information, p. 126-128 Leave only the tick marks Slide 31 Tufte (2001) The visual display of quantitative information, p. 126-128 Erase some data to make a white grid Slide 32 Tufte (2001) The visual display of quantitative information, p. 125 Parallel boxplots Slide 33 Tufte (2001) The visual display of quantitative information, p. 125 Parallel boxplots Original has 50 horizontals and 30 vertical lines, revised needs only 10 verticals to show the same data Slide 34 Tufte (2001) The visual display of quantitative information, p. 130-133 Scatterplots Slide 35 Tufte (2001) The visual display of quantitative information, p. 130-133 Scatterplots Slide 36 Tufte (2001) The visual display of quantitative information, p. 130-133 Scatterplots Slide 37 Tufte (2001) The visual display of quantitative information, p. 133 Turn axes into quartiles Slide 38 Tufte (2001) The visual display of quantitative information, p. 113 Age distribution of the population of France Slide 39 Draft figure: Branch TA Analysis of Worm et al. (2006) Science 314:787-790 How do people cite Worm et al. (2006)? P-value Sample size