kann man die Legende in einem barplot irgendwie außerhalb des Plots darstellen?
Mein jetziges Beispiel sieht so aus:
Code: Alles auswählen
import matplotlib.pyplot as plt
import numpy as np
fig = plt.figure()
ax = fig.add_subplot(111)
width = 0.15
x = (1,2,3,4,5,6,7,8,9,10)
y = (1,2,3,4,5,6,7,8,9,10)
z = (2,3,5,7,9,10,12,13,15,17)
N = len(x)
ind = np.arange(N)
plot1 = ax.bar( ind,y, width, color = 'black')
plot2 = ax.bar( ind+width,z, width, color = 'orange')
plt.xticks(ind, x, ha = 'right')
fig.legend((plot1[0], plot2[0]), ('das erste', 'das zweite'), 'center right')
plt.show()
Hat jemand eine Idee, wie man die Legende komplett neben den Plot kriegt?
Bin für jeden Hinweis dankbar.
Gruß Isa