Ich kann scheinen, um herauszufinden, wie die Griffe und Etiketten von matplotlib.patches.Patch
an die Legende übergeben.matplotlib benutzerdefinierte Legende mit Schraffur
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
a_val = 0.6
colors = ['#EA5739','#FEFFBE','#4BB05C']
circ1 = mpatches.Patch(facecolor=colors[0],alpha=a_val,hatch=['\\\\'],label='Label1')
circ2= mpatches.Patch(facecolor=colors[1],alpha=a_val,hatch='o',label='Label2')
circ3 = mpatches.Patch(facecolor=colors[2],alpha=a_val,hatch='+',label='Label3')
fig,(ax) = plt.subplots()
ax.legend(handles = [circ1,circ2,circ3],loc=2)
plt.tight_layout()
Warum ist die Legende im obigen Beispiel leer?
Es war die 'Luke = ['\\\']'. Jetzt scheinen sich die Dinge zu benehmen. Vielen Dank! – dubbbdan