xxxxxxxxxx
import matplotlib.pyplot as plt
#Generate legend
leg = plt.legend()
#Disable opacity for legend
for lh in leg.legendHandles:
lh.set_alpha(1)
xxxxxxxxxx
leg = plt.legend()
for lh in leg.legend_handles:
lh._legmarker.set_alpha(1)