Skip to content
Snippets Groups Projects
Commit a4afbdba authored by Ingram Jaccard's avatar Ingram Jaccard
Browse files

edit fig.2

parent 807b1d73
No related branches found
No related tags found
No related merge requests found
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
......@@ -425,7 +425,7 @@ knitr::include_graphics(here::here("analysis", "figures", "figure1.pdf"))
Figures 1d-e show that energy and carbon intensities of consumption are particularly high in the lower four deciles, while the higher deciles do not show large differences in weighted average energy and carbon intensity. The different intensities of household consumption across European expenditure deciles can be attributed to a combination of two plausible causes: first, if the composition of consumption baskets systematically differs according to the level of household expenditure. Second, if energy and carbon intensity within individual consumption sectors systematically differs according to the level of household expenditure.
```{r , fig.width=8, fig.height=2}
```{r , fig.width=8, fig.height=2.5}
pdat_basket = get_sector_summary_by_eu_ntile_direct(eu_q_count) %>%
ungroup() %>%
......@@ -462,20 +462,35 @@ pdat = pdat_int_co2eq %>%
pdat$facet = factor(pdat$indicator, levels = c("Expenditure share (%)", "Energy intensity (MJ/€)", "Carbon intensity (kgCO2eq/€)"))
a = ggplot(pdat, aes(x=value, y=five_sectors, color=factor(eu_q_rank))) + #I added factor on eu_q_rank, to go back, remove factor call and remove 'discrete'
#geom_point(shape=18, alpha=0.75) +
#a = ggplot(pdat, aes(x=value, y=five_sectors, color=eu_q_rank)) +
# #geom_point(shape=18, alpha=0.75) +
# geom_text(label="I", alpha=0.75, fontface="bold") +
# scale_color_viridis(option = "A", end = 0.8,
# direction = -1,
# breaks = c(1, 5, 10),
# name="European\ndecile") +
# facet_wrap(~facet, scales="free_x") +
# theme_minimal() +
# labs(x="",y="") +
# theme(text=element_text(size=13, family="Liberation Sans Narrow"),
# panel.spacing = unit(2.5, "lines"))
a = ggplot(pdat, aes(x=value, y=five_sectors, color=eu_q_rank)) +
geom_text(label="I", alpha=0.75, fontface="bold") +
scale_color_viridis(option = "A", end = 0.8,
direction = -1,
discrete = TRUE, # I added here, remove to go back to original
breaks = c(1, 5, 10),
name="European\ndecile") +
facet_wrap(~facet, scales="free_x") +
scale_colour_viridis_b(option = "A", end = 0.8,
direction = -1,
breaks = c(2,3,4,5,6,7,8,9),
#guide_legend(),
guide = guide_colorsteps(show.limits=TRUE),
name="European\ndecile") +
facet_wrap(~facet, scales="free_x",
strip.position="bottom") +
theme_minimal() +
labs(x="",y="") +
theme(text=element_text(size=13, family="Liberation Sans Narrow"),
panel.spacing = unit(2.5, "lines"))
panel.spacing = unit(2.5, "lines"),
strip.placement="outside")
ggsave(here("analysis", "figures", "figure2.pdf"), device=cairo_pdf)
```
......
No preview for this file type
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment