Matplotlib: figlegend only print the first letter

I am trying to print a figlegend with only one line, but I only get the first letter. I have the following script to create a graph:

from pylab import * k = plot((0, 1),(1, 1)) figlegend((k),('Limit'),loc='lower center') savefig('test.pdf') 

Exit: output

What am I doing wrong? (Or is it a mistake?)

+7
source share
1 answer

I did not find out if this is an error or intentional (for any reason) in matplotlib, but in order to get the full legend label, you need to leave a trailing comma in the list of labels:

 figlegend((k),('Limit',),loc='lower center') 

change this line and your code:

 from pylab import * k = plot((0, 1),(1, 1)) figlegend((k),('Limit',),loc='lower center') savefig('test.pdf') 

displays the number:

full legend label

+15
source

All Articles