{"action":"created","comment":{"url":"https://api.github.com/repos/matplotlib/matplotlib/pulls/comments/57516664","id":57516664,"diff_hunk":"@@ -52,6 +52,51 @@ def test_boxarrow():\n                   bbox=dict(boxstyle=stylename, fc=\"w\", ec=\"k\"))\n \n \n+def prepare_fancyarrow_dpi_cor_test():\n+    \"\"\"\n+    Convenience function that prepares and return a FancyArrowPatch. It aims\n+    at being used to test that the size of the arrow head does not depend on\n+    the DPI value of the exported picture.\n+\n+    NB: this function *is not* a test in itself!\n+    \"\"\"\n+    fig2 = plt.figure(\"fancyarrow_dpi_cor_test\", figsize=(4, 3), dpi=50)\n+    ax = fig2.add_subplot(111)\n+    ax.set_xlim([0, 1])\n+    ax.set_ylim([0, 1])\n+    ax.add_patch(mpatches.FancyArrowPatch(posA=(0.3, 0.4), posB=(0.8, 0.6),\n+                                          lw=3, arrowstyle=u'->',\n+                                          mutation_scale=100))\n+    return fig2\n+\n+\n+@image_comparison(baseline_images=['fancyarrow_dpi_cor_100dpi'],\n+                  remove_text=True, extensions=['png'],\n+                  savefig_kwarg=dict(dpi=100))\n+def test_fancyarrow_dpi_cor_100dpi():\n+    \"\"\"\n+    Check the export of a FancyArrowPatch @ 100 DPI. FancyArrowPatch is\n+    instanciated through a dedicated function because another similar test","path":"lib/matplotlib/tests/test_arrow_patches.py","position":55,"original_position":55,"commit_id":"1df0f7e64dded84befb88fb4a9ce047c5cb20136","original_commit_id":"1df0f7e64dded84befb88fb4a9ce047c5cb20136","user":{"login":"QuLogic","id":302469,"avatar_url":"https://avatars.githubusercontent.com/u/302469?v=3","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":"instantiated","created_at":"2016-03-26T17:35:40Z","updated_at":"2016-03-26T17:35:40Z","html_url":"https://github.com/matplotlib/matplotlib/pull/6054#discussion_r57516664","pull_request_url":"https://api.github.com/repos/matplotlib/matplotlib/pulls/6054","_links":{"self":{"href":"https://api.github.com/repos/matplotlib/matplotlib/pulls/comments/57516664"},"html":{"href":"https://github.com/matplotlib/matplotlib/pull/6054#discussion_r57516664"},"pull_request":{"href":"https://api.github.com/repos/matplotlib/matplotlib/pulls/6054"}}},"pull_request":{"url":"https://api.github.com/repos/matplotlib/matplotlib/pulls/6054","id":60428918,"html_url":"https://github.com/matplotlib/matplotlib/pull/6054","diff_url":"https://github.com/matplotlib/matplotlib/pull/6054.diff","patch_url":"https://github.com/matplotlib/matplotlib/pull/6054.patch","issue_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/6054","number":6054,"state":"open","locked":false,"title":"Patch issue #6035","user":{"login":"afvincent","id":17270724,"avatar_url":"https://avatars.githubusercontent.com/u/17270724?v=3","gravatar_id":"","url":"https://api.github.com/users/afvincent","html_url":"https://github.com/afvincent","followers_url":"https://api.github.com/users/afvincent/followers","following_url":"https://api.github.com/users/afvincent/following{/other_user}","gists_url":"https://api.github.com/users/afvincent/gists{/gist_id}","starred_url":"https://api.github.com/users/afvincent/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/afvincent/subscriptions","organizations_url":"https://api.github.com/users/afvincent/orgs","repos_url":"https://api.github.com/users/afvincent/repos","events_url":"https://api.github.com/users/afvincent/events{/privacy}","received_events_url":"https://api.github.com/users/afvincent/received_events","type":"User","site_admin":false},"body":"Here is a proposition of patch that should fix issue #6035, without breaking `annotate` (at least the relevant unit test seems still OK). \r\n\r\nAs @efiring suggested, I tried not to directly modify the value of the attribute `mutation_scale` (as it is exposed as an argument). Basically, the idea is to scale `mutation_scale` accordingly to the DPI correction (`dpi_cor`), inside `get_path_in_displaycoord`, which is called in the `draw` method of the `FancyPatchArrow` class. This way, the head (and tail) size of a `FancyPatchArrow` should not depend on the DPI value. \r\n\r\nBesides, I removed the same kind of scaling operation that was done “externally” in `annotate` (in `text.py`), since it is now performed directly inside `FancyArrowPatch`. As `test_fancyarrow` still is OK, I would assume nothing has been broken.\r\n\r\nI also added an `image_comparison` test (well in fact two, one for the PNG export at 100 DPI and another one at 200 DPI). Visually both exported pictures look the same in term of the size of the arrow head. Concerning the code in itself, it seems a bit clunky to me to use two separate test functions only to export with two different DPI values identical figures, but I did not managed to get a working `class Test_*`… (Nevertheless, the current situation should do the job.)\r\n\r\nPS: I struggled a bit with git (I “had to” remove one branch from my fork): I hope everything is fine with the commits for the PR.","created_at":"2016-02-23T23:23:27Z","updated_at":"2016-03-26T17:35:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d36eaa8b7a6085d422989f39068a5272152ef210","assignee":null,"milestone":{"url":"https://api.github.com/repos/matplotlib/matplotlib/milestones/14","html_url":"https://github.com/matplotlib/matplotlib/milestones/2.0%20(style%20change%20major%20release)","labels_url":"https://api.github.com/repos/matplotlib/matplotlib/milestones/14/labels","id":662004,"number":14,"title":"2.0 (style change major release)","description":"Style changes only","creator":{"login":"tacaswell","id":199813,"avatar_url":"https://avatars.githubusercontent.com/u/199813?v=3","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":61,"closed_issues":218,"state":"open","created_at":"2014-05-17T14:28:22Z","updated_at":"2016-03-23T17:45:55Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/matplotlib/matplotlib/pulls/6054/commits","review_comments_url":"https://api.github.com/repos/matplotlib/matplotlib/pulls/6054/comments","review_comment_url":"https://api.github.com/repos/matplotlib/matplotlib/pulls/comments{/number}","comments_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/6054/comments","statuses_url":"https://api.github.com/repos/matplotlib/matplotlib/statuses/1df0f7e64dded84befb88fb4a9ce047c5cb20136","head":{"label":"afvincent:patch-issue-6035","ref":"patch-issue-6035","sha":"1df0f7e64dded84befb88fb4a9ce047c5cb20136","user":{"login":"afvincent","id":17270724,"avatar_url":"https://avatars.githubusercontent.com/u/17270724?v=3","gravatar_id":"","url":"https://api.github.com/users/afvincent","html_url":"https://github.com/afvincent","followers_url":"https://api.github.com/users/afvincent/followers","following_url":"https://api.github.com/users/afvincent/following{/other_user}","gists_url":"https://api.github.com/users/afvincent/gists{/gist_id}","starred_url":"https://api.github.com/users/afvincent/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/afvincent/subscriptions","organizations_url":"https://api.github.com/users/afvincent/orgs","repos_url":"https://api.github.com/users/afvincent/repos","events_url":"https://api.github.com/users/afvincent/events{/privacy}","received_events_url":"https://api.github.com/users/afvincent/received_events","type":"User","site_admin":false},"repo":{"id":51927147,"name":"matplotlib","full_name":"afvincent/matplotlib","owner":{"login":"afvincent","id":17270724,"avatar_url":"https://avatars.githubusercontent.com/u/17270724?v=3","gravatar_id":"","url":"https://api.github.com/users/afvincent","html_url":"https://github.com/afvincent","followers_url":"https://api.github.com/users/afvincent/followers","following_url":"https://api.github.com/users/afvincent/following{/other_user}","gists_url":"https://api.github.com/users/afvincent/gists{/gist_id}","starred_url":"https://api.github.com/users/afvincent/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/afvincent/subscriptions","organizations_url":"https://api.github.com/users/afvincent/orgs","repos_url":"https://api.github.com/users/afvincent/repos","events_url":"https://api.github.com/users/afvincent/events{/privacy}","received_events_url":"https://api.github.com/users/afvincent/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/afvincent/matplotlib","description":"matplotlib: plotting with Python","fork":true,"url":"https://api.github.com/repos/afvincent/matplotlib","forks_url":"https://api.github.com/repos/afvincent/matplotlib/forks","keys_url":"https://api.github.com/repos/afvincent/matplotlib/keys{/key_id}","collaborators_url":"https://api.github.com/repos/afvincent/matplotlib/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/afvincent/matplotlib/teams","hooks_url":"https://api.github.com/repos/afvincent/matplotlib/hooks","issue_events_url":"https://api.github.com/repos/afvincent/matplotlib/issues/events{/number}","events_url":"https://api.github.com/repos/afvincent/matplotlib/events","assignees_url":"https://api.github.com/repos/afvincent/matplotlib/assignees{/user}","branches_url":"https://api.github.com/repos/afvincent/matplotlib/branches{/branch}","tags_url":"https://api.github.com/repos/afvincent/matplotlib/tags","blobs_url":"https://api.github.com/repos/afvincent/matplotlib/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/afvincent/matplotlib/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/afvincent/matplotlib/git/refs{/sha}","trees_url":"https://api.github.com/repos/afvincent/matplotlib/git/trees{/sha}","statuses_url":"https://api.github.com/repos/afvincent/matplotlib/statuses/{sha}","languages_url":"https://api.github.com/repos/afvincent/matplotlib/languages","stargazers_url":"https://api.github.com/repos/afvincent/matplotlib/stargazers","contributors_url":"https://api.github.com/repos/afvincent/matplotlib/contributors","subscribers_url":"https://api.github.com/repos/afvincent/matplotlib/subscribers","subscription_url":"https://api.github.com/repos/afvincent/matplotlib/subscription","commits_url":"https://api.github.com/repos/afvincent/matplotlib/commits{/sha}","git_commits_url":"https://api.github.com/repos/afvincent/matplotlib/git/commits{/sha}","comments_url":"https://api.github.com/repos/afvincent/matplotlib/comments{/number}","issue_comment_url":"https://api.github.com/repos/afvincent/matplotlib/issues/comments{/number}","contents_url":"https://api.github.com/repos/afvincent/matplotlib/contents/{+path}","compare_url":"https://api.github.com/repos/afvincent/matplotlib/compare/{base}...{head}","merges_url":"https://api.github.com/repos/afvincent/matplotlib/merges","archive_url":"https://api.github.com/repos/afvincent/matplotlib/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/afvincent/matplotlib/downloads","issues_url":"https://api.github.com/repos/afvincent/matplotlib/issues{/number}","pulls_url":"https://api.github.com/repos/afvincent/matplotlib/pulls{/number}","milestones_url":"https://api.github.com/repos/afvincent/matplotlib/milestones{/number}","notifications_url":"https://api.github.com/repos/afvincent/matplotlib/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/afvincent/matplotlib/labels{/name}","releases_url":"https://api.github.com/repos/afvincent/matplotlib/releases{/id}","deployments_url":"https://api.github.com/repos/afvincent/matplotlib/deployments","created_at":"2016-02-17T14:09:45Z","updated_at":"2016-02-17T14:09:53Z","pushed_at":"2016-03-07T22:09:17Z","git_url":"git://github.com/afvincent/matplotlib.git","ssh_url":"git@github.com:afvincent/matplotlib.git","clone_url":"https://github.com/afvincent/matplotlib.git","svn_url":"https://github.com/afvincent/matplotlib","homepage":"http://matplotlib.org/","size":275951,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"matplotlib:master","ref":"master","sha":"1ca59772473c761dc2d358c084c55b083b826e7b","user":{"login":"matplotlib","id":215947,"avatar_url":"https://avatars.githubusercontent.com/u/215947?v=3","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://avatars.githubusercontent.com/u/215947?v=3","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":"2016-03-26T16:58:48Z","pushed_at":"2016-03-26T14:59:15Z","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":390265,"stargazers_count":3429,"watchers_count":3429,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1756,"mirror_url":null,"open_issues_count":870,"forks":1756,"open_issues":870,"watchers":3429,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/matplotlib/matplotlib/pulls/6054"},"html":{"href":"https://github.com/matplotlib/matplotlib/pull/6054"},"issue":{"href":"https://api.github.com/repos/matplotlib/matplotlib/issues/6054"},"comments":{"href":"https://api.github.com/repos/matplotlib/matplotlib/issues/6054/comments"},"review_comments":{"href":"https://api.github.com/repos/matplotlib/matplotlib/pulls/6054/comments"},"review_comment":{"href":"https://api.github.com/repos/matplotlib/matplotlib/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/matplotlib/matplotlib/pulls/6054/commits"},"statuses":{"href":"https://api.github.com/repos/matplotlib/matplotlib/statuses/1df0f7e64dded84befb88fb4a9ce047c5cb20136"}}}}