Alle Dateien aus dem Pythonkurs
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

23 lines
492 B

#! ./bin/python
#encoding: utf-8
import matplotlib.pyplot as plt
import numpy as np
jahre= np.array(['2018','2019', '2020'])
aepfel= np.array([1000,1500,2000])
erdbeeren =np.array([500,950,900])
bananen=np.array([400,800,750])
breite = 0.6
fig,ax = plt.subplots()
#ax.legend('Verkäufe')
ax.bar(jahre,bananen,color='yellow')
ax.bar(jahre,erdbeeren,bottom=bananen,color='red')
ax.bar(jahre,aepfel,bottom=erdbeeren,color='green')
plt.legend(['Bananen','Erdbeeren','Äpfel'])
plt.show()