class: inverse, center, middle # 36-315: Statistical Graphics and Visualization ## Lab 3 Meghan Hall <br> Department of Statistics & Data Science <br> Carnegie Mellon University <br> June 1, 2021 --- layout: true <div class="my-footer"><span>cmu-36315.netlify.app</span></div> --- # Today <br> .large[More practice] <br> <br> <br> .large[Details with bar charts] <br> <br> <br> .large[Visualizing distributions] --- # Adding extra info efficiently .medium[Adding info to axis] ```r # move the custom axis to x or y mutate(custom_axis = paste0(judge, "\n", n, " episodes")) ``` <br> -- .medium[Highlighting a certain group] ```r # move the highlight variable to fill mutate(highlight_2013 = ifelse(year == 2013, "highlight", "normal")) ``` --- # Lollipop chart <img src="figs/Lab1/lollipop-1.png" width="504" style="display: block; margin: auto;" /> --- # Lollipop chart <br> <br> .medium[Effective when you're comparing many categories] <br> <br> .medium[Use a combination of `geom_segment` to draw the lines and `geom_point` to mark the ends] --- # Comparing distributions <br> .medium[Box plots] <br> .medium[Violin plots] <br> .medium[Ridgeline plots] <br> .medium[**Beeswarm plots**] --- # Beeswarm plot <img src="figs/Lab1/beeswarm-1.png" width="504" style="display: block; margin: auto;" /> --- # Beeswarm plot <br> <br> .medium[Uses *smart* jittering] <br> .medium[Useful when there are few enough data points to see them all] <br> .medium[Needs `ggbeeswarm`] --- # Upcoming <br> .large[Lab assignment due 11:30am EDT Wednesday!] <br> .medium[Ask questions on Piazza if they don't get answered here] <br> .large[Lecture 5 on Wednesday June 2] <br> .medium[Line charts and working with time] <br> .large[Graphic critique] <br> .medium[Follow instructions on syllabus, due before midterm]