In [1]:
%matplotlib inline
In [2]:
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import matplotlib as mpl
In [3]:
from mplstyle.enfo import PLTenfo
from mplstyle.tz import PLTtz
enfo_plt = PLTenfo()
tz_plt = PLTtz()
In [4]:
ghd_bs = pd.read_csv('data/ghd_bs.csv')
ghd_bs = ghd_bs.set_index('jahr')
In [5]:
ghd_bs.head(6)
Out[5]:
In [6]:
ghd_bs.Gas.describe()
Out[6]:
In [7]:
tz_plt.get_available_styles()
In [8]:
tz_plt.set_style(plt_style='jupyter-notebook')
In [9]:
enfo_plt.get_available_styles()
In [10]:
enfo_plt.set_style(color_style='enfo')
In [11]:
colors = enfo_plt.get_colors()
In [12]:
enfo_plt.get_colors().keys()
Out[12]:
In [13]:
fig, (ax0, ax1) = plt.subplots(2, 1, figsize=[9, 6],
gridspec_kw={'height_ratios': [1, 0.1]})
ax1.axis('off')
color = [colors[i] for i in ghd_bs.columns]
ghd_bs.plot.bar(ax=ax0, stacked=True, width=0.5, edgecolor=None,
zorder=2, rot=0, legend=False, color=color)
handles, labels = ax0.get_legend_handles_labels()
ax0.legend(handles, labels, loc='upper center', ncol=3,
bbox_to_anchor=(0.5, -0.05))
ax0.set_xlabel('').set_visible(False)
ax0.set_title('Endenergie PJ', fontsize=20, fontweight='bold')
Out[13]:
In [14]:
enfo_plt.set_style?
In [15]:
%whos