Answers for "change text in legend matplotlib"

0

change text in legend matplotlib

plt.plot(range(10), label='Some very long label')
plt.plot(range(1,11), label='Short label')
L=plt.legend()
L.get_texts()[0].set_text('make it short')
plt.savefig('temp.png')
Posted by: Guest on May-14-2020

Python Answers by Framework

Browse Popular Code Answers by Language