ich verwende Python 2.7 und habe den folgenden Code:
Code: Alles auswählen
import matplotlib.pyplot as plt
import numpy as np
x_axis = np.array([0,2,4])
x_ticks = ["Apfel", "Banane", "Birne"]
y_1 = [10,7,5]
y_2 = [3,2,4]
plt.xticks(x_axis,x_ticks,color="red",rotation="vertical",)
plt.bar(x_axis-0.4,y_1,color="black",label="Supermarkt1")
plt.bar(x_axis+0.4,y_2,color="grey",label = "Supermarkt2")
plt.legend()
plt.tight_layout()
Vielen Dank und viele Grüße,
Simon