Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

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')
Comment

PREVIOUS NEXT
Code Example
Python :: numpy as array 
Python :: how to check an element in a list in python 
Python :: pandas divide one column by another 
Python :: tkinter get child in frame 
Python :: E: Unable to locate package python-gobject 
Python :: contains duplicate in python 
Python :: chr() python 
Python :: turn false true column into 0 1 pandas 
Python :: esp8266 micropython ds18b20 
Python :: plt.tick_params 
Python :: pythonwrite to file 
Python :: tasks discord py 
Python :: python list divide 
Python :: python mean 
Python :: jpython 
Python :: extract zip file in python zipfile 
Python :: python remove everything after character 
Python :: how to write a while statement in python 
Python :: Python NumPy copyto function Syntax 
Python :: python round down 
Python :: seaborn boxplot 
Python :: python get list memory size 
Python :: python convert from float to decimal 
Python :: Using python permutations function on a list 
Python :: python recursively print directory 
Python :: correlation between images python 
Python :: check if all characters in a string are the same python 
Python :: django static files 
Python :: apply lambda function to multiple columns pandas 
Python :: find the index of a character in a string python 
ADD CONTENT
Topic
Content
Source link
Name
7+5 =