#!/usr/bin/python3 # Beispiel für ein Säulendiagramm: Strompreis import matplotlib.pyplot as plt dat = {"2007":0.2065, "2010":0.24065, "2013":0.292, "2016":0.2973, "2019":0.2983} plt.figure(figsize=(6,3), facecolor='azure') fd={'fontsize':'medium','fontweight':'bold'} plt.title('Preis elektrischer Energie für \ deutsche Haushalte',fontdict=fd,loc='center') plt.ylabel('\u20ac / kWh') # mit Euro-Symbol plt.bar(dat.keys(),dat.values(), width=0.5,color="steelblue") plt.savefig(fname='strompreis.png')