Economic Policy Visualization
Climate · Facets
June 12, 2023
Attention!
Facets show small multiples (or subplots) for different subsets of data
Code | Result |
---|---|
facet_wrap(~continent) | Plot for each continent |
facet_wrap(continent ~ year) | Plot for each continent/year |
facet_wrap(…, ncol = 1, nrow = 1) | Specify grid layout with columns and rows |
facet_wrap(…, scales = “fixed”) | Specify fixed axis, alternatively “free_x” or “free_y” |
facet_wrap(…, dir = “h”) | Direction of facets, horizontal (“h”) or vertical (“v”) |
facet_wrap(…, strip.position = “top”) | Positioning of the facet labels (strips) |
PI 5620 Advanced Economic Policy | Summer term 2023