{"action":"created","comment":{"url":"https://api.github.com/repos/matplotlib/matplotlib/pulls/comments/178449757","pull_request_review_id":108510692,"id":178449757,"diff_hunk":"@@ -272,3 +272,41 @@ def test_empty_layout():\n \n     fig = plt.gcf()\n     fig.tight_layout()\n+\n+\n+def test_big_decorators_horizontal():\n+    \"Test that warning emited when xlabel too big\"\n+    fig, ax = plt.subplots(figsize=(3, 2))\n+    ax.set_xlabel('a' * 100)\n+    with warnings.catch_warnings(record=True) as w:\n+        fig.tight_layout()\n+        assert len(w) == 1\n+\n+\n+def test_big_decorators_verticaltal():","path":"lib/matplotlib/tests/test_tightlayout.py","position":15,"original_position":15,"commit_id":"473071994ee0ebf56a20f1787f8c078390953709","original_commit_id":"473071994ee0ebf56a20f1787f8c078390953709","user":{"login":"QuLogic","id":302469,"avatar_url":"https://avatars2.githubusercontent.com/u/302469?v=4","gravatar_id":"","url":"https://api.github.com/users/QuLogic","html_url":"https://github.com/QuLogic","followers_url":"https://api.github.com/users/QuLogic/followers","following_url":"https://api.github.com/users/QuLogic/following{/other_user}","gists_url":"https://api.github.com/users/QuLogic/gists{/gist_id}","starred_url":"https://api.github.com/users/QuLogic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/QuLogic/subscriptions","organizations_url":"https://api.github.com/users/QuLogic/orgs","repos_url":"https://api.github.com/users/QuLogic/repos","events_url":"https://api.github.com/users/QuLogic/events{/privacy}","received_events_url":"https://api.github.com/users/QuLogic/received_events","type":"User","site_admin":false},"body":"`verticaltal`?","created_at":"2018-04-01T06:57:55Z","updated_at":"2018-04-01T06:59:53Z","html_url":"https://github.com/matplotlib/matplotlib/pull/10915#discussion_r178449757","pull_request_url":"https://api.github.com/repos/matplotlib/matplotlib/pulls/10915","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/matplotlib/matplotlib/pulls/comments/178449757"},"html":{"href":"https://github.com/matplotlib/matplotlib/pull/10915#discussion_r178449757"},"pull_request":{"href":"https://api.github.com/repos/matplotlib/matplotlib/pulls/10915"}}},"pull_request":{"url":"https://api.github.com/repos/matplotlib/matplotlib/pulls/10915","id":178222285,"html_url":"https://github.com/matplotlib/matplotlib/pull/10915","diff_url":"https://github.com/matplotlib/matplotlib/pull/10915.diff","patch_url":"https://github.com/matplotlib/matplotlib/pull/10915.patch","issue_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/10915","number":10915,"state":"open","locked":false,"title":"FIX: tight_layout having negative width axes","user":{"login":"jklymak","id":1562854,"avatar_url":"https://avatars0.githubusercontent.com/u/1562854?v=4","gravatar_id":"","url":"https://api.github.com/users/jklymak","html_url":"https://github.com/jklymak","followers_url":"https://api.github.com/users/jklymak/followers","following_url":"https://api.github.com/users/jklymak/following{/other_user}","gists_url":"https://api.github.com/users/jklymak/gists{/gist_id}","starred_url":"https://api.github.com/users/jklymak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jklymak/subscriptions","organizations_url":"https://api.github.com/users/jklymak/orgs","repos_url":"https://api.github.com/users/jklymak/repos","events_url":"https://api.github.com/users/jklymak/events{/privacy}","received_events_url":"https://api.github.com/users/jklymak/received_events","type":"User","site_admin":false},"body":"## PR Summary\r\n\r\nCloses #4413 #8062\r\n\r\n`fig.tight_layout()` could cause axes to flip sign if the title was too big, and cause the whole thing to Error if the title was really big.  This PR adds a check that the axes width and height is still greater than zero after the margins have been set.  \r\n\r\nIt would be nice to just collapse the axes when this happens, but thats actually a bit of work to fake because subplots_adjust 's space parameter is specified as a fraction of average axes width (not the way I'd have expressed this parameter, but...)\r\n\r\nDiscussion in #4413 suggested that something could be done to ignore the title, but otherwise compute the tight_layout.  I think that's theoretically possible, but if someone has a really long title they should probably shorten it or adjust the spacing manually rather than trying to make `tight_layout` do something magical.\r\n\r\n```python\r\nimport matplotlib.pyplot as plt\r\n\r\nfig, axs = plt.subplots(1, 2, figsize=(6,2))\r\nleng = 95\r\naxs[0].set_title('A'+('a' * leng))\r\naxs[0].set_yticks([])\r\naxs[1].set_title('B' +('b' * leng))\r\naxs[1].set_yticks([])\r\naxs[0].set_xlabel('title length %d' % leng)\r\nfig.tight_layout()\r\nplt.show()\r\n```\r\n\r\n![t45](https://user-images.githubusercontent.com/1562854/38069500-98e40950-32cb-11e8-804e-82c66b576f44.png)\r\n![t46](https://user-images.githubusercontent.com/1562854/38069504-9b7865c6-32cb-11e8-9ef7-89c682a3a14e.png)\r\n![t95](https://user-images.githubusercontent.com/1562854/38069505-9e177ed4-32cb-11e8-9c22-c6a3c32710f7.png)\r\n\r\nFor the second and third plots, a warning is emitted...\r\n\r\n## PR Checklist\r\n\r\n- [x] Has Pytest style unit tests\r\n- [x] Code is PEP 8 compliant\r\n\r\n<!--\r\nThank you so much for your PR!  To help us review your contribution, please\r\nconsider the following points:\r\n\r\n- A development guide is available at https://matplotlib.org/devdocs/devel/index.html.\r\n\r\n- Help with git and github is available at\r\n  https://matplotlib.org/devel/gitwash/development_workflow.html.\r\n\r\n- Do not create the PR out of master, but out of a separate branch.\r\n\r\n- The PR title should summarize the changes, for example \"Raise ValueError on\r\n  non-numeric input to set_xlim\".  Avoid non-descriptive titles such as\r\n  \"Addresses issue #8576\".\r\n\r\n- The summary should provide at least 1-2 sentences describing the pull request\r\n  in detail (Why is this change required?  What problem does it solve?) and\r\n  link to any relevant issues.\r\n\r\n- If you are contributing fixes to docstrings, please pay attention to\r\n  http://matplotlib.org/devel/documenting_mpl.html#formatting.  In particular,\r\n  note the difference between using single backquotes, double backquotes, and\r\n  asterisks in the markup.\r\n\r\nWe understand that PRs can sometimes be overwhelming, especially as the\r\nreviews start coming in.  Please let us know if the reviews are unclear or\r\nthe recommended next step seems overly demanding, if you would like help in\r\naddressing a reviewer's comments, or if you have been waiting too long to hear\r\nback on your PR.\r\n-->","created_at":"2018-03-29T04:05:16Z","updated_at":"2018-04-01T06:59:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b4a1bbd48422ca639cdd71e2413d8814b434a063","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":{"url":"https://api.github.com/repos/matplotlib/matplotlib/milestones/23","html_url":"https://github.com/matplotlib/matplotlib/milestone/23","labels_url":"https://api.github.com/repos/matplotlib/matplotlib/milestones/23/labels","id":1542657,"number":23,"title":"v3.0","description":"Big ticket items:\r\n\r\n - drop support for python 2","creator":{"login":"tacaswell","id":199813,"avatar_url":"https://avatars3.githubusercontent.com/u/199813?v=4","gravatar_id":"","url":"https://api.github.com/users/tacaswell","html_url":"https://github.com/tacaswell","followers_url":"https://api.github.com/users/tacaswell/followers","following_url":"https://api.github.com/users/tacaswell/following{/other_user}","gists_url":"https://api.github.com/users/tacaswell/gists{/gist_id}","starred_url":"https://api.github.com/users/tacaswell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tacaswell/subscriptions","organizations_url":"https://api.github.com/users/tacaswell/orgs","repos_url":"https://api.github.com/users/tacaswell/repos","events_url":"https://api.github.com/users/tacaswell/events{/privacy}","received_events_url":"https://api.github.com/users/tacaswell/received_events","type":"User","site_admin":false},"open_issues":207,"closed_issues":176,"state":"open","created_at":"2016-01-25T21:06:49Z","updated_at":"2018-04-01T04:49:29Z","due_on":"2018-07-01T07:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/matplotlib/matplotlib/pulls/10915/commits","review_comments_url":"https://api.github.com/repos/matplotlib/matplotlib/pulls/10915/comments","review_comment_url":"https://api.github.com/repos/matplotlib/matplotlib/pulls/comments{/number}","comments_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/10915/comments","statuses_url":"https://api.github.com/repos/matplotlib/matplotlib/statuses/473071994ee0ebf56a20f1787f8c078390953709","head":{"label":"jklymak:fix-tight-layout-too-small","ref":"fix-tight-layout-too-small","sha":"473071994ee0ebf56a20f1787f8c078390953709","user":{"login":"jklymak","id":1562854,"avatar_url":"https://avatars0.githubusercontent.com/u/1562854?v=4","gravatar_id":"","url":"https://api.github.com/users/jklymak","html_url":"https://github.com/jklymak","followers_url":"https://api.github.com/users/jklymak/followers","following_url":"https://api.github.com/users/jklymak/following{/other_user}","gists_url":"https://api.github.com/users/jklymak/gists{/gist_id}","starred_url":"https://api.github.com/users/jklymak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jklymak/subscriptions","organizations_url":"https://api.github.com/users/jklymak/orgs","repos_url":"https://api.github.com/users/jklymak/repos","events_url":"https://api.github.com/users/jklymak/events{/privacy}","received_events_url":"https://api.github.com/users/jklymak/received_events","type":"User","site_admin":false},"repo":{"id":93901119,"name":"matplotlib","full_name":"jklymak/matplotlib","owner":{"login":"jklymak","id":1562854,"avatar_url":"https://avatars0.githubusercontent.com/u/1562854?v=4","gravatar_id":"","url":"https://api.github.com/users/jklymak","html_url":"https://github.com/jklymak","followers_url":"https://api.github.com/users/jklymak/followers","following_url":"https://api.github.com/users/jklymak/following{/other_user}","gists_url":"https://api.github.com/users/jklymak/gists{/gist_id}","starred_url":"https://api.github.com/users/jklymak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jklymak/subscriptions","organizations_url":"https://api.github.com/users/jklymak/orgs","repos_url":"https://api.github.com/users/jklymak/repos","events_url":"https://api.github.com/users/jklymak/events{/privacy}","received_events_url":"https://api.github.com/users/jklymak/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jklymak/matplotlib","description":"matplotlib: plotting with Python","fork":true,"url":"https://api.github.com/repos/jklymak/matplotlib","forks_url":"https://api.github.com/repos/jklymak/matplotlib/forks","keys_url":"https://api.github.com/repos/jklymak/matplotlib/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jklymak/matplotlib/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jklymak/matplotlib/teams","hooks_url":"https://api.github.com/repos/jklymak/matplotlib/hooks","issue_events_url":"https://api.github.com/repos/jklymak/matplotlib/issues/events{/number}","events_url":"https://api.github.com/repos/jklymak/matplotlib/events","assignees_url":"https://api.github.com/repos/jklymak/matplotlib/assignees{/user}","branches_url":"https://api.github.com/repos/jklymak/matplotlib/branches{/branch}","tags_url":"https://api.github.com/repos/jklymak/matplotlib/tags","blobs_url":"https://api.github.com/repos/jklymak/matplotlib/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jklymak/matplotlib/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jklymak/matplotlib/git/refs{/sha}","trees_url":"https://api.github.com/repos/jklymak/matplotlib/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jklymak/matplotlib/statuses/{sha}","languages_url":"https://api.github.com/repos/jklymak/matplotlib/languages","stargazers_url":"https://api.github.com/repos/jklymak/matplotlib/stargazers","contributors_url":"https://api.github.com/repos/jklymak/matplotlib/contributors","subscribers_url":"https://api.github.com/repos/jklymak/matplotlib/subscribers","subscription_url":"https://api.github.com/repos/jklymak/matplotlib/subscription","commits_url":"https://api.github.com/repos/jklymak/matplotlib/commits{/sha}","git_commits_url":"https://api.github.com/repos/jklymak/matplotlib/git/commits{/sha}","comments_url":"https://api.github.com/repos/jklymak/matplotlib/comments{/number}","issue_comment_url":"https://api.github.com/repos/jklymak/matplotlib/issues/comments{/number}","contents_url":"https://api.github.com/repos/jklymak/matplotlib/contents/{+path}","compare_url":"https://api.github.com/repos/jklymak/matplotlib/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jklymak/matplotlib/merges","archive_url":"https://api.github.com/repos/jklymak/matplotlib/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jklymak/matplotlib/downloads","issues_url":"https://api.github.com/repos/jklymak/matplotlib/issues{/number}","pulls_url":"https://api.github.com/repos/jklymak/matplotlib/pulls{/number}","milestones_url":"https://api.github.com/repos/jklymak/matplotlib/milestones{/number}","notifications_url":"https://api.github.com/repos/jklymak/matplotlib/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jklymak/matplotlib/labels{/name}","releases_url":"https://api.github.com/repos/jklymak/matplotlib/releases{/id}","deployments_url":"https://api.github.com/repos/jklymak/matplotlib/deployments","created_at":"2017-06-09T22:24:38Z","updated_at":"2017-06-10T22:48:17Z","pushed_at":"2018-04-01T04:45:17Z","git_url":"git://github.com/jklymak/matplotlib.git","ssh_url":"git@github.com:jklymak/matplotlib.git","clone_url":"https://github.com/jklymak/matplotlib.git","svn_url":"https://github.com/jklymak/matplotlib","homepage":"http://matplotlib.org/","size":328944,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"placeholder"}},"base":{"label":"matplotlib:master","ref":"master","sha":"5a8f4eab271864d7ab8f2143e4a7c6b50c75748a","user":{"login":"matplotlib","id":215947,"avatar_url":"https://avatars0.githubusercontent.com/u/215947?v=4","gravatar_id":"","url":"https://api.github.com/users/matplotlib","html_url":"https://github.com/matplotlib","followers_url":"https://api.github.com/users/matplotlib/followers","following_url":"https://api.github.com/users/matplotlib/following{/other_user}","gists_url":"https://api.github.com/users/matplotlib/gists{/gist_id}","starred_url":"https://api.github.com/users/matplotlib/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matplotlib/subscriptions","organizations_url":"https://api.github.com/users/matplotlib/orgs","repos_url":"https://api.github.com/users/matplotlib/repos","events_url":"https://api.github.com/users/matplotlib/events{/privacy}","received_events_url":"https://api.github.com/users/matplotlib/received_events","type":"Organization","site_admin":false},"repo":{"id":1385122,"name":"matplotlib","full_name":"matplotlib/matplotlib","owner":{"login":"matplotlib","id":215947,"avatar_url":"https://avatars0.githubusercontent.com/u/215947?v=4","gravatar_id":"","url":"https://api.github.com/users/matplotlib","html_url":"https://github.com/matplotlib","followers_url":"https://api.github.com/users/matplotlib/followers","following_url":"https://api.github.com/users/matplotlib/following{/other_user}","gists_url":"https://api.github.com/users/matplotlib/gists{/gist_id}","starred_url":"https://api.github.com/users/matplotlib/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matplotlib/subscriptions","organizations_url":"https://api.github.com/users/matplotlib/orgs","repos_url":"https://api.github.com/users/matplotlib/repos","events_url":"https://api.github.com/users/matplotlib/events{/privacy}","received_events_url":"https://api.github.com/users/matplotlib/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/matplotlib/matplotlib","description":"matplotlib: plotting with Python","fork":false,"url":"https://api.github.com/repos/matplotlib/matplotlib","forks_url":"https://api.github.com/repos/matplotlib/matplotlib/forks","keys_url":"https://api.github.com/repos/matplotlib/matplotlib/keys{/key_id}","collaborators_url":"https://api.github.com/repos/matplotlib/matplotlib/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/matplotlib/matplotlib/teams","hooks_url":"https://api.github.com/repos/matplotlib/matplotlib/hooks","issue_events_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/events{/number}","events_url":"https://api.github.com/repos/matplotlib/matplotlib/events","assignees_url":"https://api.github.com/repos/matplotlib/matplotlib/assignees{/user}","branches_url":"https://api.github.com/repos/matplotlib/matplotlib/branches{/branch}","tags_url":"https://api.github.com/repos/matplotlib/matplotlib/tags","blobs_url":"https://api.github.com/repos/matplotlib/matplotlib/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/matplotlib/matplotlib/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/matplotlib/matplotlib/git/refs{/sha}","trees_url":"https://api.github.com/repos/matplotlib/matplotlib/git/trees{/sha}","statuses_url":"https://api.github.com/repos/matplotlib/matplotlib/statuses/{sha}","languages_url":"https://api.github.com/repos/matplotlib/matplotlib/languages","stargazers_url":"https://api.github.com/repos/matplotlib/matplotlib/stargazers","contributors_url":"https://api.github.com/repos/matplotlib/matplotlib/contributors","subscribers_url":"https://api.github.com/repos/matplotlib/matplotlib/subscribers","subscription_url":"https://api.github.com/repos/matplotlib/matplotlib/subscription","commits_url":"https://api.github.com/repos/matplotlib/matplotlib/commits{/sha}","git_commits_url":"https://api.github.com/repos/matplotlib/matplotlib/git/commits{/sha}","comments_url":"https://api.github.com/repos/matplotlib/matplotlib/comments{/number}","issue_comment_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/comments{/number}","contents_url":"https://api.github.com/repos/matplotlib/matplotlib/contents/{+path}","compare_url":"https://api.github.com/repos/matplotlib/matplotlib/compare/{base}...{head}","merges_url":"https://api.github.com/repos/matplotlib/matplotlib/merges","archive_url":"https://api.github.com/repos/matplotlib/matplotlib/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/matplotlib/matplotlib/downloads","issues_url":"https://api.github.com/repos/matplotlib/matplotlib/issues{/number}","pulls_url":"https://api.github.com/repos/matplotlib/matplotlib/pulls{/number}","milestones_url":"https://api.github.com/repos/matplotlib/matplotlib/milestones{/number}","notifications_url":"https://api.github.com/repos/matplotlib/matplotlib/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/matplotlib/matplotlib/labels{/name}","releases_url":"https://api.github.com/repos/matplotlib/matplotlib/releases{/id}","deployments_url":"https://api.github.com/repos/matplotlib/matplotlib/deployments","created_at":"2011-02-19T03:17:12Z","updated_at":"2018-04-01T04:06:16Z","pushed_at":"2018-04-01T06:53:01Z","git_url":"git://github.com/matplotlib/matplotlib.git","ssh_url":"git@github.com:matplotlib/matplotlib.git","clone_url":"https://github.com/matplotlib/matplotlib.git","svn_url":"https://github.com/matplotlib/matplotlib","homepage":"http://matplotlib.org/","size":325488,"stargazers_count":7017,"watchers_count":7017,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3307,"mirror_url":null,"archived":false,"open_issues_count":1339,"license":null,"forks":3307,"open_issues":1339,"watchers":7017,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/matplotlib/matplotlib/pulls/10915"},"html":{"href":"https://github.com/matplotlib/matplotlib/pull/10915"},"issue":{"href":"https://api.github.com/repos/matplotlib/matplotlib/issues/10915"},"comments":{"href":"https://api.github.com/repos/matplotlib/matplotlib/issues/10915/comments"},"review_comments":{"href":"https://api.github.com/repos/matplotlib/matplotlib/pulls/10915/comments"},"review_comment":{"href":"https://api.github.com/repos/matplotlib/matplotlib/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/matplotlib/matplotlib/pulls/10915/commits"},"statuses":{"href":"https://api.github.com/repos/matplotlib/matplotlib/statuses/473071994ee0ebf56a20f1787f8c078390953709"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"QuLogic"}}