Plot Timeseries DataΒΆ

../_images/sphx_glr_plot_timeseries_001.png

Out:

model scenario  region       variable       unit  year      value
0  MESSAGE-GLOBIOM  SSP2-26  R5ASIA  Emissions|CO2  Mt CO2/yr  2005  10488.011
1  MESSAGE-GLOBIOM  SSP2-26  R5ASIA  Emissions|CO2  Mt CO2/yr  2010  13437.424
2  MESSAGE-GLOBIOM  SSP2-26  R5ASIA  Emissions|CO2  Mt CO2/yr  2020  15054.143
3  MESSAGE-GLOBIOM  SSP2-26  R5ASIA  Emissions|CO2  Mt CO2/yr  2030  12528.573
4  MESSAGE-GLOBIOM  SSP2-26  R5ASIA  Emissions|CO2  Mt CO2/yr  2040   9499.867

import matplotlib.pyplot as plt
import pyam

fname = 'data.csv'

df = pyam.IamDataFrame(fname, encoding='ISO-8859-1')

df = (df
      .filter(variable='Emissions|CO2')
      .filter(region='World', keep=False)
      )

print(df.head())

fig, ax = plt.subplots(figsize=(8, 8))
df.line_plot(ax=ax, color='region')
plt.show()

Total running time of the script: ( 0 minutes 0.210 seconds)

Gallery generated by Sphinx-Gallery