class: inverse, center, middle # 36-315: Statistical Graphics and Visualization ## Lab 6 Meghan Hall <br> Department of Statistics & Data Science <br> Carnegie Mellon University <br> June 10, 2021 --- layout: true <div class="my-footer"><span>cmu-36315.netlify.app</span></div> --- # Today <br> .large[Taking plots to the next level] <br> .medium[effective *and* elegant] <br> .large[Redoing plots we've seen before] <br> .medium[get familiar with the syntax and the options] --- # Syntax ```r theme(panel.background = element_blank(), panel.grid.major.y = element_line(color = "grey90", size = 0.3)) ``` <br> .large[Most of these non-data elements are in the `theme` layer] <br> <br> <br> .large[Elements inherit properties hierarchically] <br> .medium[can specify `panel.grid.major` to refer to all gridlines or `axis.title` to refer to all axis titles] <br> .medium[or `panel.grid.major.x` or `axis.title.y` to be more specific] --- # Theme elements <br> <br> .large[`element_blank`: removes an element] -- .large[`element_rect`: edits borders and backgrounds] -- .large[`element_line`: edits lines] -- .large[`element_text`: edits text] --- # Resources <br> <br> .large[[https://ggplot2.tidyverse.org/reference/theme.html](https://ggplot2.tidyverse.org/reference/theme.html)] .large[[https://ggplot2.tidyverse.org/reference/element.html](https://ggplot2.tidyverse.org/reference/element.html)] .large[[https://henrywang.nl/wp-content/uploads/2020/04/ggplot2-themes.pdf](https://henrywang.nl/wp-content/uploads/2020/04/ggplot2-themes.pdf)] .large[[https://ggplot2tor.com/scales/](https://ggplot2tor.com/scales/)] --- # Upcoming <br> .large[Lab assignment due 11:30am EDT Friday!] <br> .medium[Ask questions on Piazza if they don't get answered here] <br> .large[Lecture 9 on Friday June 11] <br> .medium[Themes, fonts, colors, annotations] <br> .large[Graphic critique]