{"action":"created","comment":{"url":"https://api.github.com/repos/matplotlib/matplotlib/pulls/comments/74942731","id":74942731,"diff_hunk":"@@ -623,9 +637,16 @@ def draw_image(self, gc, x, y, im):\n         # reference the image in the pgf picture\n         writeln(self.fh, r\"\\begin{pgfscope}\")\n         self._print_pgf_clip(gc)\n-        h, w = im.shape[:2]\n         f = 1. / self.dpi  # from display coords to inch\n-        writeln(self.fh, r\"\\pgftext[at=\\pgfqpoint{%fin}{%fin},left,bottom]{\\pgfimage[interpolate=true,width=%fin,height=%fin]{%s}}\" % (x * f, y * f, w * f, h * f, fname_img))\n+        if transform is None:\n+            writeln(self.fh, r\"\\pgfsys@transformshift{%fin}{%fin}\" % (x * f, y * f))\n+            w, h = w * f, h * f\n+        else:\n+            tr1, tr2, tr3, tr4, tr5, tr6 = transform.frozen().to_values()\n+            writeln(self.fh, r\"\\pgfsys@transformcm{%f}{%f}{%f}{%f}{%fin}{%fin}\" % (tr1 * f, tr2 * f, tr3 * f, tr4 * f, (tr5 + x) * f, (tr6 + y) * f))\n+            w = h = 1  # scale is already included in the transform\n+        interp = str(transform is None).lower()  # interpolation in PDF reader\n+        writeln(self.fh, r\"\\pgftext[left,bottom]{\\pgfimage[interpolate=%s,width=%fin,height=%fin]{%s}}\" % (interp, w, h, fname_img))","path":"lib/matplotlib/backends/backend_pgf.py","position":null,"original_position":42,"commit_id":"7f1f81f4c6bbddce6bf7e45e4ec4138e6e3c90f9","original_commit_id":"5b3b25e7937573b37df74245db569f774c23b316","user":{"login":"f0k","id":629706,"avatar_url":"https://avatars.githubusercontent.com/u/629706?v=3","gravatar_id":"","url":"https://api.github.com/users/f0k","html_url":"https://github.com/f0k","followers_url":"https://api.github.com/users/f0k/followers","following_url":"https://api.github.com/users/f0k/following{/other_user}","gists_url":"https://api.github.com/users/f0k/gists{/gist_id}","starred_url":"https://api.github.com/users/f0k/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/f0k/subscriptions","organizations_url":"https://api.github.com/users/f0k/orgs","repos_url":"https://api.github.com/users/f0k/repos","events_url":"https://api.github.com/users/f0k/events{/privacy}","received_events_url":"https://api.github.com/users/f0k/received_events","type":"User","site_admin":false},"body":"Okay, modified this PR to fix long lines in my code. No PEP8 errors remaining in the parts I've touched.","created_at":"2016-08-16T14:15:19Z","updated_at":"2016-08-16T14:15:19Z","html_url":"https://github.com/matplotlib/matplotlib/pull/6792#discussion_r74942731","pull_request_url":"https://api.github.com/repos/matplotlib/matplotlib/pulls/6792","_links":{"self":{"href":"https://api.github.com/repos/matplotlib/matplotlib/pulls/comments/74942731"},"html":{"href":"https://github.com/matplotlib/matplotlib/pull/6792#discussion_r74942731"},"pull_request":{"href":"https://api.github.com/repos/matplotlib/matplotlib/pulls/6792"}}},"pull_request":{"url":"https://api.github.com/repos/matplotlib/matplotlib/pulls/6792","id":77836565,"html_url":"https://github.com/matplotlib/matplotlib/pull/6792","diff_url":"https://github.com/matplotlib/matplotlib/pull/6792.diff","patch_url":"https://github.com/matplotlib/matplotlib/pull/6792.patch","issue_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/6792","number":6792,"state":"open","locked":false,"title":"PGF Backend: Support interpolation='none'","user":{"login":"f0k","id":629706,"avatar_url":"https://avatars.githubusercontent.com/u/629706?v=3","gravatar_id":"","url":"https://api.github.com/users/f0k","html_url":"https://github.com/f0k","followers_url":"https://api.github.com/users/f0k/followers","following_url":"https://api.github.com/users/f0k/following{/other_user}","gists_url":"https://api.github.com/users/f0k/gists{/gist_id}","starred_url":"https://api.github.com/users/f0k/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/f0k/subscriptions","organizations_url":"https://api.github.com/users/f0k/orgs","repos_url":"https://api.github.com/users/f0k/repos","events_url":"https://api.github.com/users/f0k/events{/privacy}","received_events_url":"https://api.github.com/users/f0k/received_events","type":"User","site_admin":false},"body":"As discussed in #6740, the PGF backend currently doesn't support `interpolation='none'`, which means all raster graphics are interpolated prior to saving them. This adds full support for affine image transforms.\r\n\r\nIn the old backend, it took me 10 minutes to implement this from what I already had in #6740: https://gist.github.com/f0k/f8c87ffd82488c2ed303989592bf4ebd/eeaa54c8b98f84fd2f80caf4305034fc1eeeb76f#file-backend_mypgf-py-L61-L62\r\nFor the new backend, things seem to have changed quite a bit, but documentation is still lacking. It took me an hour of fiddling around. Now the code produces the same result as the PDF backend for [the affine transform demo](http://matplotlib.org/examples/api/demo_affine_image.html) in its [current version](https://github.com/matplotlib/matplotlib/blob/master/examples/api/demo_affine_image.py), which does not include the skewing test any more.\r\n\r\nCloses #6740.","created_at":"2016-07-18T16:20:31Z","updated_at":"2016-08-16T14:15:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2da7bc6ed713cec61419d08e913519bf5a6eea9e","assignee":null,"assignees":[],"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":48,"closed_issues":508,"state":"open","created_at":"2014-05-17T14:28:22Z","updated_at":"2016-08-16T04:31:07Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/matplotlib/matplotlib/pulls/6792/commits","review_comments_url":"https://api.github.com/repos/matplotlib/matplotlib/pulls/6792/comments","review_comment_url":"https://api.github.com/repos/matplotlib/matplotlib/pulls/comments{/number}","comments_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/6792/comments","statuses_url":"https://api.github.com/repos/matplotlib/matplotlib/statuses/7f1f81f4c6bbddce6bf7e45e4ec4138e6e3c90f9","head":{"label":"f0k:pgf-transform","ref":"pgf-transform","sha":"7f1f81f4c6bbddce6bf7e45e4ec4138e6e3c90f9","user":{"login":"f0k","id":629706,"avatar_url":"https://avatars.githubusercontent.com/u/629706?v=3","gravatar_id":"","url":"https://api.github.com/users/f0k","html_url":"https://github.com/f0k","followers_url":"https://api.github.com/users/f0k/followers","following_url":"https://api.github.com/users/f0k/following{/other_user}","gists_url":"https://api.github.com/users/f0k/gists{/gist_id}","starred_url":"https://api.github.com/users/f0k/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/f0k/subscriptions","organizations_url":"https://api.github.com/users/f0k/orgs","repos_url":"https://api.github.com/users/f0k/repos","events_url":"https://api.github.com/users/f0k/events{/privacy}","received_events_url":"https://api.github.com/users/f0k/received_events","type":"User","site_admin":false},"repo":{"id":4425419,"name":"matplotlib","full_name":"f0k/matplotlib","owner":{"login":"f0k","id":629706,"avatar_url":"https://avatars.githubusercontent.com/u/629706?v=3","gravatar_id":"","url":"https://api.github.com/users/f0k","html_url":"https://github.com/f0k","followers_url":"https://api.github.com/users/f0k/followers","following_url":"https://api.github.com/users/f0k/following{/other_user}","gists_url":"https://api.github.com/users/f0k/gists{/gist_id}","starred_url":"https://api.github.com/users/f0k/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/f0k/subscriptions","organizations_url":"https://api.github.com/users/f0k/orgs","repos_url":"https://api.github.com/users/f0k/repos","events_url":"https://api.github.com/users/f0k/events{/privacy}","received_events_url":"https://api.github.com/users/f0k/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/f0k/matplotlib","description":"","fork":true,"url":"https://api.github.com/repos/f0k/matplotlib","forks_url":"https://api.github.com/repos/f0k/matplotlib/forks","keys_url":"https://api.github.com/repos/f0k/matplotlib/keys{/key_id}","collaborators_url":"https://api.github.com/repos/f0k/matplotlib/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/f0k/matplotlib/teams","hooks_url":"https://api.github.com/repos/f0k/matplotlib/hooks","issue_events_url":"https://api.github.com/repos/f0k/matplotlib/issues/events{/number}","events_url":"https://api.github.com/repos/f0k/matplotlib/events","assignees_url":"https://api.github.com/repos/f0k/matplotlib/assignees{/user}","branches_url":"https://api.github.com/repos/f0k/matplotlib/branches{/branch}","tags_url":"https://api.github.com/repos/f0k/matplotlib/tags","blobs_url":"https://api.github.com/repos/f0k/matplotlib/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/f0k/matplotlib/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/f0k/matplotlib/git/refs{/sha}","trees_url":"https://api.github.com/repos/f0k/matplotlib/git/trees{/sha}","statuses_url":"https://api.github.com/repos/f0k/matplotlib/statuses/{sha}","languages_url":"https://api.github.com/repos/f0k/matplotlib/languages","stargazers_url":"https://api.github.com/repos/f0k/matplotlib/stargazers","contributors_url":"https://api.github.com/repos/f0k/matplotlib/contributors","subscribers_url":"https://api.github.com/repos/f0k/matplotlib/subscribers","subscription_url":"https://api.github.com/repos/f0k/matplotlib/subscription","commits_url":"https://api.github.com/repos/f0k/matplotlib/commits{/sha}","git_commits_url":"https://api.github.com/repos/f0k/matplotlib/git/commits{/sha}","comments_url":"https://api.github.com/repos/f0k/matplotlib/comments{/number}","issue_comment_url":"https://api.github.com/repos/f0k/matplotlib/issues/comments{/number}","contents_url":"https://api.github.com/repos/f0k/matplotlib/contents/{+path}","compare_url":"https://api.github.com/repos/f0k/matplotlib/compare/{base}...{head}","merges_url":"https://api.github.com/repos/f0k/matplotlib/merges","archive_url":"https://api.github.com/repos/f0k/matplotlib/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/f0k/matplotlib/downloads","issues_url":"https://api.github.com/repos/f0k/matplotlib/issues{/number}","pulls_url":"https://api.github.com/repos/f0k/matplotlib/pulls{/number}","milestones_url":"https://api.github.com/repos/f0k/matplotlib/milestones{/number}","notifications_url":"https://api.github.com/repos/f0k/matplotlib/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/f0k/matplotlib/labels{/name}","releases_url":"https://api.github.com/repos/f0k/matplotlib/releases{/id}","deployments_url":"https://api.github.com/repos/f0k/matplotlib/deployments","created_at":"2012-05-23T21:15:17Z","updated_at":"2013-09-24T08:23:00Z","pushed_at":"2016-08-16T14:13:56Z","git_url":"git://github.com/f0k/matplotlib.git","ssh_url":"git@github.com:f0k/matplotlib.git","clone_url":"https://github.com/f0k/matplotlib.git","svn_url":"https://github.com/f0k/matplotlib","homepage":"","size":285202,"stargazers_count":1,"watchers_count":1,"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":1,"default_branch":"master"}},"base":{"label":"matplotlib:master","ref":"master","sha":"2cdb5aab4f2a623185182f4e812e120c208bcedc","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-08-16T05:27:41Z","pushed_at":"2016-08-16T14:13:59Z","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":396950,"stargazers_count":3981,"watchers_count":3981,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1966,"mirror_url":null,"open_issues_count":971,"forks":1966,"open_issues":971,"watchers":3981,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/matplotlib/matplotlib/pulls/6792"},"html":{"href":"https://github.com/matplotlib/matplotlib/pull/6792"},"issue":{"href":"https://api.github.com/repos/matplotlib/matplotlib/issues/6792"},"comments":{"href":"https://api.github.com/repos/matplotlib/matplotlib/issues/6792/comments"},"review_comments":{"href":"https://api.github.com/repos/matplotlib/matplotlib/pulls/6792/comments"},"review_comment":{"href":"https://api.github.com/repos/matplotlib/matplotlib/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/matplotlib/matplotlib/pulls/6792/commits"},"statuses":{"href":"https://api.github.com/repos/matplotlib/matplotlib/statuses/7f1f81f4c6bbddce6bf7e45e4ec4138e6e3c90f9"}}}}
{"actor":{"display_login":"f0k"}}