class: center, middle, inverse, title-slide # ggeasy (easy theme adjustments) ## a flipbook | made with Xaringan ###
Gina Reynolds, May 2019 ###
--- --- count: false .left-panel-easy-rotate[ ```r library(ggeasy) library(gapminder) library(tidyverse) gapminder %>% filter(year == 1992) %>% ggplot() + aes(x = gdpPercap, y = lifeExp) + geom_point(alpha = .8, shape = 21, fill = "white") + aes(col = continent, fill = continent) + geom_point(alpha = .3, shape = 21) + aes(size = pop) + scale_size(guide = F) + labs(title = "Wealth and expected longevity\n in 1992") + labs(subtitle = "Data from gapminder package in R") + labs(x = "GDP per Capita") + labs(y = "Life Expectency") + labs(tag = "Plot 1") + labs(col = "Continent", fill = "Continent") + labs(caption = "Vis: @EvaMaeRey with ggplot") + easy_all_text_color(color = "green") ``` ] .right-panel-easy-rotate[ <img src="themes_ggeasy_files/figure-html/easy_rotate_1_output-1.png" width="100%" /> ] --- count: false .left-panel-easy-rotate[ ```r library(ggeasy) library(gapminder) library(tidyverse) gapminder %>% filter(year == 1992) %>% ggplot() + aes(x = gdpPercap, y = lifeExp) + geom_point(alpha = .8, shape = 21, fill = "white") + aes(col = continent, fill = continent) + geom_point(alpha = .3, shape = 21) + aes(size = pop) + scale_size(guide = F) + labs(title = "Wealth and expected longevity\n in 1992") + labs(subtitle = "Data from gapminder package in R") + labs(x = "GDP per Capita") + labs(y = "Life Expectency") + labs(tag = "Plot 1") + labs(col = "Continent", fill = "Continent") + labs(caption = "Vis: @EvaMaeRey with ggplot") + * easy_all_text_size(size = 14) ``` ] .right-panel-easy-rotate[ <img src="themes_ggeasy_files/figure-html/easy_rotate_2_output-1.png" width="100%" /> ] --- count: false .left-panel-easy-rotate[ ```r library(ggeasy) library(gapminder) library(tidyverse) gapminder %>% filter(year == 1992) %>% ggplot() + aes(x = gdpPercap, y = lifeExp) + geom_point(alpha = .8, shape = 21, fill = "white") + aes(col = continent, fill = continent) + geom_point(alpha = .3, shape = 21) + aes(size = pop) + scale_size(guide = F) + labs(title = "Wealth and expected longevity\n in 1992") + labs(subtitle = "Data from gapminder package in R") + labs(x = "GDP per Capita") + labs(y = "Life Expectency") + labs(tag = "Plot 1") + labs(col = "Continent", fill = "Continent") + labs(caption = "Vis: @EvaMaeRey with ggplot") + * easy_x_axis_labels_size(size = 20) ``` ] .right-panel-easy-rotate[ <img src="themes_ggeasy_files/figure-html/easy_rotate_3_output-1.png" width="100%" /> ] --- count: false .left-panel-easy-rotate[ ```r library(ggeasy) library(gapminder) library(tidyverse) gapminder %>% filter(year == 1992) %>% ggplot() + aes(x = gdpPercap, y = lifeExp) + geom_point(alpha = .8, shape = 21, fill = "white") + aes(col = continent, fill = continent) + geom_point(alpha = .3, shape = 21) + aes(size = pop) + scale_size(guide = F) + labs(title = "Wealth and expected longevity\n in 1992") + labs(subtitle = "Data from gapminder package in R") + labs(x = "GDP per Capita") + labs(y = "Life Expectency") + labs(tag = "Plot 1") + labs(col = "Continent", fill = "Continent") + labs(caption = "Vis: @EvaMaeRey with ggplot") + * easy_legend_at(to = "bottom") ``` ] .right-panel-easy-rotate[ <img src="themes_ggeasy_files/figure-html/easy_rotate_4_output-1.png" width="100%" /> ] --- count: false .left-panel-easy-rotate[ ```r library(ggeasy) library(gapminder) library(tidyverse) gapminder %>% filter(year == 1992) %>% ggplot() + aes(x = gdpPercap, y = lifeExp) + geom_point(alpha = .8, shape = 21, fill = "white") + aes(col = continent, fill = continent) + geom_point(alpha = .3, shape = 21) + aes(size = pop) + scale_size(guide = F) + labs(title = "Wealth and expected longevity\n in 1992") + labs(subtitle = "Data from gapminder package in R") + labs(x = "GDP per Capita") + labs(y = "Life Expectency") + labs(tag = "Plot 1") + labs(col = "Continent", fill = "Continent") + labs(caption = "Vis: @EvaMaeRey with ggplot") + * easy_adjust_legend(to = "right") ``` ] .right-panel-easy-rotate[ <img src="themes_ggeasy_files/figure-html/easy_rotate_5_output-1.png" width="100%" /> ] --- count: false .left-panel-easy-rotate[ ```r library(ggeasy) library(gapminder) library(tidyverse) gapminder %>% filter(year == 1992) %>% ggplot() + aes(x = gdpPercap, y = lifeExp) + geom_point(alpha = .8, shape = 21, fill = "white") + aes(col = continent, fill = continent) + geom_point(alpha = .3, shape = 21) + aes(size = pop) + scale_size(guide = F) + labs(title = "Wealth and expected longevity\n in 1992") + labs(subtitle = "Data from gapminder package in R") + labs(x = "GDP per Capita") + labs(y = "Life Expectency") + labs(tag = "Plot 1") + labs(col = "Continent", fill = "Continent") + labs(caption = "Vis: @EvaMaeRey with ggplot") + * easy_plot_caption_size(size = 15) ``` ] .right-panel-easy-rotate[ <img src="themes_ggeasy_files/figure-html/easy_rotate_6_output-1.png" width="100%" /> ] --- count: false .left-panel-easy-rotate[ ```r library(ggeasy) library(gapminder) library(tidyverse) gapminder %>% filter(year == 1992) %>% ggplot() + aes(x = gdpPercap, y = lifeExp) + geom_point(alpha = .8, shape = 21, fill = "white") + aes(col = continent, fill = continent) + geom_point(alpha = .3, shape = 21) + aes(size = pop) + scale_size(guide = F) + labs(title = "Wealth and expected longevity\n in 1992") + labs(subtitle = "Data from gapminder package in R") + labs(x = "GDP per Capita") + labs(y = "Life Expectency") + labs(tag = "Plot 1") + labs(col = "Continent", fill = "Continent") + labs(caption = "Vis: @EvaMaeRey with ggplot") + * easy_remove_y_axis() ``` ] .right-panel-easy-rotate[ <img src="themes_ggeasy_files/figure-html/easy_rotate_7_output-1.png" width="100%" /> ] --- count: false .left-panel-easy-rotate[ ```r library(ggeasy) library(gapminder) library(tidyverse) gapminder %>% filter(year == 1992) %>% ggplot() + aes(x = gdpPercap, y = lifeExp) + geom_point(alpha = .8, shape = 21, fill = "white") + aes(col = continent, fill = continent) + geom_point(alpha = .3, shape = 21) + aes(size = pop) + scale_size(guide = F) + labs(title = "Wealth and expected longevity\n in 1992") + labs(subtitle = "Data from gapminder package in R") + labs(x = "GDP per Capita") + labs(y = "Life Expectency") + labs(tag = "Plot 1") + labs(col = "Continent", fill = "Continent") + labs(caption = "Vis: @EvaMaeRey with ggplot") + * easy_add_legend_title("hi") ``` ] .right-panel-easy-rotate[ <img src="themes_ggeasy_files/figure-html/easy_rotate_8_output-1.png" width="100%" /> ] --- count: false .left-panel-easy-rotate[ ```r library(ggeasy) library(gapminder) library(tidyverse) gapminder %>% filter(year == 1992) %>% ggplot() + aes(x = gdpPercap, y = lifeExp) + geom_point(alpha = .8, shape = 21, fill = "white") + aes(col = continent, fill = continent) + geom_point(alpha = .3, shape = 21) + aes(size = pop) + scale_size(guide = F) + labs(title = "Wealth and expected longevity\n in 1992") + labs(subtitle = "Data from gapminder package in R") + labs(x = "GDP per Capita") + labs(y = "Life Expectency") + labs(tag = "Plot 1") + labs(col = "Continent", fill = "Continent") + labs(caption = "Vis: @EvaMaeRey with ggplot") + * easy_adjust_legend() ``` ] .right-panel-easy-rotate[ <img src="themes_ggeasy_files/figure-html/easy_rotate_9_output-1.png" width="100%" /> ] --- count: false .left-panel-easy-rotate[ ```r library(ggeasy) library(gapminder) library(tidyverse) gapminder %>% filter(year == 1992) %>% ggplot() + aes(x = gdpPercap, y = lifeExp) + geom_point(alpha = .8, shape = 21, fill = "white") + aes(col = continent, fill = continent) + geom_point(alpha = .3, shape = 21) + aes(size = pop) + scale_size(guide = F) + labs(title = "Wealth and expected longevity\n in 1992") + labs(subtitle = "Data from gapminder package in R") + labs(x = "GDP per Capita") + labs(y = "Life Expectency") + labs(tag = "Plot 1") + labs(col = "Continent", fill = "Continent") + labs(caption = "Vis: @EvaMaeRey with ggplot") + * easy_all_text_color("#889811") ``` ] .right-panel-easy-rotate[ <img src="themes_ggeasy_files/figure-html/easy_rotate_10_output-1.png" width="100%" /> ] --- count: false .left-panel-easy-rotate[ ```r library(ggeasy) library(gapminder) library(tidyverse) gapminder %>% filter(year == 1992) %>% ggplot() + aes(x = gdpPercap, y = lifeExp) + geom_point(alpha = .8, shape = 21, fill = "white") + aes(col = continent, fill = continent) + geom_point(alpha = .3, shape = 21) + aes(size = pop) + scale_size(guide = F) + labs(title = "Wealth and expected longevity\n in 1992") + labs(subtitle = "Data from gapminder package in R") + labs(x = "GDP per Capita") + labs(y = "Life Expectency") + labs(tag = "Plot 1") + labs(col = "Continent", fill = "Continent") + labs(caption = "Vis: @EvaMaeRey with ggplot") + * easy_all_text_colour("#889811") ``` ] .right-panel-easy-rotate[ <img src="themes_ggeasy_files/figure-html/easy_rotate_11_output-1.png" width="100%" /> ] --- count: false .left-panel-easy-rotate[ ```r library(ggeasy) library(gapminder) library(tidyverse) gapminder %>% filter(year == 1992) %>% ggplot() + aes(x = gdpPercap, y = lifeExp) + geom_point(alpha = .8, shape = 21, fill = "white") + aes(col = continent, fill = continent) + geom_point(alpha = .3, shape = 21) + aes(size = pop) + scale_size(guide = F) + labs(title = "Wealth and expected longevity\n in 1992") + labs(subtitle = "Data from gapminder package in R") + labs(x = "GDP per Capita") + labs(y = "Life Expectency") + labs(tag = "Plot 1") + labs(col = "Continent", fill = "Continent") + labs(caption = "Vis: @EvaMaeRey with ggplot") + * easy_remove_legend() ``` ] .right-panel-easy-rotate[ <img src="themes_ggeasy_files/figure-html/easy_rotate_12_output-1.png" width="100%" /> ] --- count: false .left-panel-easy-rotate[ ```r library(ggeasy) library(gapminder) library(tidyverse) gapminder %>% filter(year == 1992) %>% ggplot() + aes(x = gdpPercap, y = lifeExp) + geom_point(alpha = .8, shape = 21, fill = "white") + aes(col = continent, fill = continent) + geom_point(alpha = .3, shape = 21) + aes(size = pop) + scale_size(guide = F) + labs(title = "Wealth and expected longevity\n in 1992") + labs(subtitle = "Data from gapminder package in R") + labs(x = "GDP per Capita") + labs(y = "Life Expectency") + labs(tag = "Plot 1") + labs(col = "Continent", fill = "Continent") + labs(caption = "Vis: @EvaMaeRey with ggplot") + * easy_remove_legend_title() ``` ] .right-panel-easy-rotate[ <img src="themes_ggeasy_files/figure-html/easy_rotate_13_output-1.png" width="100%" /> ] <style> .left-panel-easy-rotate { color: #777; width: 38.6138613861386%; height: 92%; float: left; font-size: 80% } .right-panel-easy-rotate { width: 59.4059405940594%; float: right; padding-left: 1%; font-size: 80% } .middle-panel-easy-rotate { width: 0%; float: left; padding-left: 1%; font-size: 80% } </style> --- <style type="text/css"> .remark-code{line-height: 1.5; font-size: 70%} .column-left { float: left; width: 33.333%; } .column-right { float: right; width: 33.333%; } .column-center { display: inline-block; width: 33.333%; } </style>