python add text to legend code example Example: python add legend title # Basic syntax: plt.legend(title="your title")