PLT. Bar (x, x_data2, color='gold', label='USES classification 1, width=width) # color=' RGB '
is random colorPLT. Bar (x, x_data3, bottom=x_data2, label='USES classification 2, color=' lightgrey ', width=width)
Font1={' family ':' KaiTi ', 'weight' : 'normal' and 'size: 11}
PLT. Legend (loc=2, frameon=False, fontsize=11, labelspacing=0.8, prop=font1)
CodePudding user response:
Online, such asCodePudding user response:
How to change? B: and I can't,CodePudding user response:
Watched some information online, it seems the legend can only use the default color, can't change itCodePudding user response:
Consult, illustrations in the text color of the modified method is solved?CodePudding user response:
https://stackoverflow.com/questions/18909696/how-to-change-the-text-colour-of-font-in-legendFinally found...
The import pylab as PLT
Legs=PLT. Legend (framealpha=0, loc='best')
For the text in legs. Get_texts () :
PLT. Setp (text, color='w')