Got a response:
legend = axes.legend() frame = legend.get_frame()
and then we can use frame.set_XXX to specify the properties of the frame.
I did not find it at first, because this is not an input argument to the plt.legend() method.
Yuxiang wang
source share