Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

title does is not displayed correctly, if there is linefeeds #239

Closed
ddale opened this issue Jun 20, 2011 · 2 comments
Closed

title does is not displayed correctly, if there is linefeeds #239

ddale opened this issue Jun 20, 2011 · 2 comments

Comments

@ddale
Copy link
Contributor

ddale commented Jun 20, 2011

Original report at SourceForge, opened Mon Nov 23 05:44:52 2009

matplotlib.pyplot.title()
does not display the title correctly, if the title has more than one ''\n" in the title string .
it would be nice to have a title, that has multiple lines.

@pelson
Copy link
Member

pelson commented Apr 16, 2012

(Obvious) Code to reproduce:

import matplotlib.pyplot as plt
plt.title('Line1\nLine2\nLine3\nLine3')
plt.plot(range(10)) 
plt.show()

I'm interested to know if any devs have any ideas about this? Whether it is even possible to do without breaking other things (such as axes positioning etc.)?

I notice that one can get some useful information about the text object which might be one way of figuring out the bounding box of the title and/or suptitle which could be used for adjusting appropriately: ax.title.get_window_extent() (once a renderer has been created).

@pelson
Copy link
Member

pelson commented Oct 18, 2012

#1109 is designed to propose a solution to this perennial problem. So whilst this issue is not fixed, it is certainly on the radar as one of the core requirements for the aforementioned MEP.

@pelson pelson closed this as completed Oct 18, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants