Data Visualisation for our Future Climate
Magnitude: The size of values.
Distribution: How data values are spread for a variable.
Ranking: The position of data within a hierarchy or scale.
Deviation: The difference between a value and an average or another value.
Parts of a whole: The relative sizes of components within a whole.
Correlation: The relationship between two variables.
Time: How a value changes over time.
Geography: The pattern of data across different locations or areas.
Alternatives to spaghetti:
Some alternatives:
# Load packages
import pandas as pd
import plotnine as gg
import matplotlib.pyplot as plt
# Load data
emissions = pd.read_csv('../data/emissions_income.csv')
# Prep data
income_order = pd.CategoricalDtype(
categories=['Low-income countries', 'Lower-middle-income countries', 'Upper-middle-income countries', 'High-income countries'],
ordered=True
)
emissions['Income'] = emissions['Income'].astype(income_order)
emissions.head()| Code | Income | Emissions | |
|---|---|---|---|
| 0 | AFG | Low-income countries | 0.253848 |
| 1 | ALB | Upper-middle-income countries | 1.591990 |
| 2 | DZA | Upper-middle-income countries | 4.233817 |
| 3 | AND | High-income countries | 5.181661 |
| 4 | AGO | Lower-middle-income countries | 0.589497 |
You have been given some data on temperature anomalies and latitude.