class: center, middle, inverse, title-slide # Ex. 3: More ggplot2 Commands ## Thematic and Display Adjustments --- count: false .panel1-the_chunk-rotate[ ```r employed_under_150K %>% group_by(Age, Sex) %>% summarise(Median = median(Earnings)) %>% ggplot() + aes(x = Age) + aes(y = Median) + geom_line() + aes(color = Sex) + labs(x="Age (Years)") + labs(y="Earnings (USD)") + labs(color = "Sex of respondent") + labs(title = "Age vs. Median Earnings by Sex") + scale_x_continuous(limits=c(0,100), breaks=c(seq(from = 0, to = 100, by = 10))) + scale_y_log10() + * theme_bw() ``` ] .panel2-the_chunk-rotate[ <img src="ex3.1_embed_files/figure-html/the_chunk_rotate_01_output-1.png" width="576" /> ] --- count: false .panel1-the_chunk-rotate[ ```r employed_under_150K %>% group_by(Age, Sex) %>% summarise(Median = median(Earnings)) %>% ggplot() + aes(x = Age) + aes(y = Median) + geom_line() + aes(color = Sex) + labs(x="Age (Years)") + labs(y="Earnings (USD)") + labs(color = "Sex of respondent") + labs(title = "Age vs. Median Earnings by Sex") + scale_x_continuous(limits=c(0,100), breaks=c(seq(from = 0, to = 100, by = 10))) + scale_y_log10() + * theme_light() ``` ] .panel2-the_chunk-rotate[ <img src="ex3.1_embed_files/figure-html/the_chunk_rotate_02_output-1.png" width="576" /> ] --- count: false .panel1-the_chunk-rotate[ ```r employed_under_150K %>% group_by(Age, Sex) %>% summarise(Median = median(Earnings)) %>% ggplot() + aes(x = Age) + aes(y = Median) + geom_line() + aes(color = Sex) + labs(x="Age (Years)") + labs(y="Earnings (USD)") + labs(color = "Sex of respondent") + labs(title = "Age vs. Median Earnings by Sex") + scale_x_continuous(limits=c(0,100), breaks=c(seq(from = 0, to = 100, by = 10))) + scale_y_log10() + * theme_gray() ``` ] .panel2-the_chunk-rotate[ <img src="ex3.1_embed_files/figure-html/the_chunk_rotate_03_output-1.png" width="576" /> ] --- count: false .panel1-the_chunk-rotate[ ```r employed_under_150K %>% group_by(Age, Sex) %>% summarise(Median = median(Earnings)) %>% ggplot() + aes(x = Age) + aes(y = Median) + geom_line() + aes(color = Sex) + labs(x="Age (Years)") + labs(y="Earnings (USD)") + labs(color = "Sex of respondent") + labs(title = "Age vs. Median Earnings by Sex") + scale_x_continuous(limits=c(0,100), breaks=c(seq(from = 0, to = 100, by = 10))) + scale_y_log10() + * theme_void() ``` ] .panel2-the_chunk-rotate[ <img src="ex3.1_embed_files/figure-html/the_chunk_rotate_04_output-1.png" width="576" /> ] --- count: false .panel1-the_chunk-rotate[ ```r employed_under_150K %>% group_by(Age, Sex) %>% summarise(Median = median(Earnings)) %>% ggplot() + aes(x = Age) + aes(y = Median) + geom_line() + aes(color = Sex) + labs(x="Age (Years)") + labs(y="Earnings (USD)") + labs(color = "Sex of respondent") + labs(title = "Age vs. Median Earnings by Sex") + scale_x_continuous(limits=c(0,100), breaks=c(seq(from = 0, to = 100, by = 10))) + scale_y_log10() + * theme_linedraw() ``` ] .panel2-the_chunk-rotate[ <img src="ex3.1_embed_files/figure-html/the_chunk_rotate_05_output-1.png" width="576" /> ] --- count: false .panel1-the_chunk-rotate[ ```r employed_under_150K %>% group_by(Age, Sex) %>% summarise(Median = median(Earnings)) %>% ggplot() + aes(x = Age) + aes(y = Median) + geom_line() + aes(color = Sex) + labs(x="Age (Years)") + labs(y="Earnings (USD)") + labs(color = "Sex of respondent") + labs(title = "Age vs. Median Earnings by Sex") + scale_x_continuous(limits=c(0,100), breaks=c(seq(from = 0, to = 100, by = 10))) + scale_y_log10() + * theme_minimal() ``` ] .panel2-the_chunk-rotate[ <img src="ex3.1_embed_files/figure-html/the_chunk_rotate_06_output-1.png" width="576" /> ] --- count: false .panel1-the_chunk-rotate[ ```r employed_under_150K %>% group_by(Age, Sex) %>% summarise(Median = median(Earnings)) %>% ggplot() + aes(x = Age) + aes(y = Median) + geom_line() + aes(color = Sex) + labs(x="Age (Years)") + labs(y="Earnings (USD)") + labs(color = "Sex of respondent") + labs(title = "Age vs. Median Earnings by Sex") + scale_x_continuous(limits=c(0,100), breaks=c(seq(from = 0, to = 100, by = 10))) + scale_y_log10() + * theme_classic() ``` ] .panel2-the_chunk-rotate[ <img src="ex3.1_embed_files/figure-html/the_chunk_rotate_07_output-1.png" width="576" /> ] --- count: false .panel1-the_chunk-rotate[ ```r employed_under_150K %>% group_by(Age, Sex) %>% summarise(Median = median(Earnings)) %>% ggplot() + aes(x = Age) + aes(y = Median) + geom_line() + aes(color = Sex) + labs(x="Age (Years)") + labs(y="Earnings (USD)") + labs(color = "Sex of respondent") + labs(title = "Age vs. Median Earnings by Sex") + scale_x_continuous(limits=c(0,100), breaks=c(seq(from = 0, to = 100, by = 10))) + scale_y_log10() + * theme_dark() ``` ] .panel2-the_chunk-rotate[ <img src="ex3.1_embed_files/figure-html/the_chunk_rotate_08_output-1.png" width="576" /> ] <style> .panel1-the_chunk-rotate { color: black; width: 49%; hight: 32%; float: left; padding-left: 1%; font-size: 80% } .panel2-the_chunk-rotate { color: black; width: 49%; hight: 32%; float: left; padding-left: 1%; font-size: 80% } .panel3-the_chunk-rotate { color: black; width: NA%; hight: 33%; float: left; padding-left: 1%; font-size: 80% } </style> <style type="text/css"> .remark-code{line-height: 1.5; font-size: 90%} @media print { .has-continuation { display: block; } } code.r.hljs.remark-code{ position: relative; overflow-x: hidden; } code.r.hljs.remark-code:hover{ overflow-x:visible; width: 500px; border-style: solid; } </style>