PyLab title/legend labels with multiple line of text

19,803

Yes, just use the \n escape sequence inside it.

element = pylab.plot(range(100))
pylab.legend([element],[ "first line \n second line"])
Share:
19,803

Related videos on Youtube

grokkaine
Author by

grokkaine

Updated on May 27, 2022

Comments

  • grokkaine
    grokkaine almost 2 years

    Is it possible to make multiple lines of text inside a title/legend label in pylab?