Make our Logo!ΒΆ

The logo combines a number of fun pyam features, including

  • line plots

  • filling data between lines

  • adding ranges of final-year data

import itertools
from pyam import IamDataFrame, IAMC_IDX

import pandas as pd
import numpy as np
import matplotlib.pyplot as plt'seaborn-deep')
/tmp/ipykernel_2439/ MatplotlibDeprecationWarning: The seaborn styles shipped by Matplotlib are deprecated since 3.6, as they no longer correspond to the styles shipped by seaborn. However, they will remain available as 'seaborn-v0_8-<style>'. Alternatively, directly use the seaborn API instead.'seaborn-deep')
def func(x, factor):
    return np.sin(x) + factor * x

x = np.linspace(0, 4, 100)
combinations = itertools.product(['m1', 'm2', 'm3', 'm4'], ['s1', 's2', 's3'])
data = [[m, s] + ['r', 'v', 'u'] + list(func(x, 0.5 + 0.1 * i)) for i, (m, s) in enumerate(combinations)]
df = IamDataFrame(pd.DataFrame(data, columns=IAMC_IDX + list(range(len(x)))))
model scenario region variable unit year value
0 m1 s1 r v u 0 0.000000
1 m1 s1 r v u 1 0.060595
2 m1 s1 r v u 2 0.121124
3 m1 s1 r v u 3 0.181522
4 m1 s1 r v u 4 0.241722
fig, ax = plt.subplots()
df.filter(scenario='s2').plot(ax=ax, color='model', legend=False, title=False)
df.filter(scenario='s2', keep=False).plot(ax=ax, linewidth=0.5, color='model',
                                          legend=False, title=False)
df.plot(ax=ax, alpha=0, color='model', fill_between=True, final_ranges=dict(linewidth=4),
        legend=False, title=False)
fig.savefig('logo.pdf', bbox_inches='tight', transparent=True, pad_inches=0)