matplotlib legend remove box

C
plt.legend(frameon=False)

Source

Also in C: