--- title: "Visualizing Data (in R)" subtitle: "An opinionated style guide
" author: "

June Choe" date: '2021-02-10' output: xaringan::moon_reader: lib_dir: libs css: [default, hygge, ninjutsu, "custom.css"] nature: ratio: 16:10 highlightStyle: 'solarized-light' highlightLines: true countIncrementalSlides: false editor_options: chunk_output_type: console --- class: middle, center ```{r setup, echo = FALSE, message = FALSE, warning = FALSE} library(tidyverse) library(Cairo) library(flipbookr) library(xaringan) library(xaringanExtra) xaringanExtra::use_search(show_icon = TRUE) knitr::opts_chunk$set(message = FALSE, warning = FALSE, comment = " ", cache = FALSE, dev = "CairoSVG") set.seed(1234) ``` ```{r, echo=FALSE, out.width="650px",out.height="400px", fig.cap="https://xkcd.com/1945"} knitr::include_graphics("https://imgs.xkcd.com/comics/scientific_paper_graph_quality.png") ``` --- # Motivation -- **Why bother improving the quality of your plot?** -- -

Helps people remember your results better

-- - Makes your findings look more **credible** -- - Increases the chance of your work being **shared** -- - Shows **respect** for your audience
-- **Goal of this presentation** -- -

Share practical, language-agnostic tips for improving readability & accessibility

-- - Walk through implementations of these ideas (w/ [R code](https://raw.githubusercontent.com/yjunechoe/sandbox/master/flipbooks/ggplot2_master/feb_2020_ggplot2.Rmd)) -- - Demonstrate that the _design_ just as important as the content --- # Outline -- **Four principles for explanatory data visualization** -- -

Make your text readable

-- - Be generous about **margins and spacing** -- - Make the **legend** clear but subtle -- - Make **color** easy on your reader's eyes --
**Showcases/tricks** - Minimal designs - Plot composition - Animations - Interactivity --- # Preliminaries .pull-left[ The `{ggplot2}` ecosystem in R: - Easy to use and highly customizable - Tons of free resources for learning - Widely used in academia - Lots of extensions ] .pull-right[ ```{r, echo=FALSE, out.width="400px", fig.align="right"} knitr::include_graphics("https://d33wubrfki0l68.cloudfront.net/2c6239d311be6d037c251c71c3902792f8c4ddd2/12f67/css/images/hex/ggplot2.png") ``` ] --- # Preliminaries .pull-left[ The `{ggplot2}` ecosystem in R: - Easy to use and highly customizable - Tons of free resources for learning - Widely used in academia - Lots of extensions ```{r, message = FALSE} library(extrafont) library(colorspace) library(patchwork) library(ggtext) library(scales) # library(gghighlight) # library(ggforce) # library(ggrepel) # library(gganimate) ``` ] .pull-right[