Filtering and plotting

Here we provide a quick example of how to filter and plot with your data, making the most of the capability provided by pyam's IamDataFrame.


In [1]:
# NBVAL_IGNORE_OUTPUT
from pymagicc import MAGICC6
from pymagicc import rcp26

import matplotlib.pyplot as plt  
plt.style.use("bmh")


Run MAGICC6.


In [2]:
with MAGICC6() as magicc:
    results = magicc.run(rcp26)

In [3]:
# NBVAL_IGNORE_OUTPUT
# Note that row ordering may vary
results.head()


Out[3]:
model scenario region variable unit time climate_model todo value
0 IMAGE RCP26 World Emissions|BC|MAGICC AFOLU Mt BC / yr 1765-07-12 MAGICC6 N/A 0.0
1 IMAGE RCP26 World|Northern Hemisphere|Land Emissions|BC|MAGICC AFOLU Mt BC / yr 1765-07-12 MAGICC6 N/A 0.0
2 IMAGE RCP26 World|Northern Hemisphere|Ocean Emissions|BC|MAGICC AFOLU Mt BC / yr 1765-07-12 MAGICC6 N/A 0.0
3 IMAGE RCP26 World|Southern Hemisphere|Land Emissions|BC|MAGICC AFOLU Mt BC / yr 1765-07-12 MAGICC6 N/A 0.0
4 IMAGE RCP26 World|Southern Hemisphere|Ocean Emissions|BC|MAGICC AFOLU Mt BC / yr 1765-07-12 MAGICC6 N/A 0.0

Filter and plot results.


In [4]:
results.filter(
    variable="*Concentrations|CO2",
).line_plot(x="time", figsize=(16, 9));



In [5]:
results.filter(
    variable="*Temperature*"
).line_plot(x="time", figsize=(16, 9));