Hi all,

I am trying to create legend with multiple-line labels, but I noticed that the 
labels are not properly aligned. I tried also changing the alignment of the 
text objects to center, but this requires separate handling of multi-line and 
single-line labels:

import matplotlib.pyplot as plt
plt.plot([1,2,3], label"multi\nline 1")
plt.plot([1,2,3], label="multi\nline 1")
plt.plot([1,2,3], label="multi\nline 2")
plt.plot([1,2,3], label=" single line")
leg=plt.legend()
#change alignment of multiline labels only
plt.setp(leg.get_texts()[:2], va='center')

I found a discussion thread on this topic:

http://article.gmane.org/gmane.comp.python.matplotlib.devel/6116

Is there a way to achieve a  clean rendering independent of number of lines?

Yours,

Bartosz
------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to