{"action":"created","comment":{"url":"https://api.github.com/repos/matplotlib/matplotlib/pulls/comments/83696123","pull_request_review_id":4522984,"id":83696123,"diff_hunk":"@@ -0,0 +1,62 @@\n+\"\"\"\n+Demonstration of using the ArbitraryNorm classes for normalization.\n+\"\"\"\n+\n+import numpy as np\n+import matplotlib.colors as colors\n+import matplotlib.pyplot as plt\n+import matplotlib.cm as cm\n+\n+x=np.linspace(0,16*np.pi,1024)\n+y=np.linspace(-1,1,512)\n+X,Y=np.meshgrid(x,y)\n+\n+data=np.zeros(X.shape)\n+\n+data[Y>0]=np.cos(X[Y>0])*Y[Y>0]**2\n+\n+for i,val in enumerate(np.arange(-1,1.1,0.2)):\n+    if val<0:data[(X>(i*(50./11)))*(Y<0)]=val\n+    if val>0:data[(X>(i*(50./11)))*(Y<0)]=val*2\n+            \n+figsize=(16,10)\n+cmap=cm.gist_rainbow\n+\n+plt.figure(figsize=figsize)","path":"doc/users/plotting/examples/colormap_normalizations_arbitrarynorm.py","position":25,"original_position":25,"commit_id":"1d55f0cdd5b46a1d5d54384cdd5c552ef1f9b3ab","original_commit_id":"1d55f0cdd5b46a1d5d54384cdd5c552ef1f9b3ab","user":{"login":"alvarosg","id":12649253,"avatar_url":"https://avatars.githubusercontent.com/u/12649253?v=3","gravatar_id":"","url":"https://api.github.com/users/alvarosg","html_url":"https://github.com/alvarosg","followers_url":"https://api.github.com/users/alvarosg/followers","following_url":"https://api.github.com/users/alvarosg/following{/other_user}","gists_url":"https://api.github.com/users/alvarosg/gists{/gist_id}","starred_url":"https://api.github.com/users/alvarosg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alvarosg/subscriptions","organizations_url":"https://api.github.com/users/alvarosg/orgs","repos_url":"https://api.github.com/users/alvarosg/repos","events_url":"https://api.github.com/users/alvarosg/events{/privacy}","received_events_url":"https://api.github.com/users/alvarosg/received_events","type":"User","site_admin":false},"body":"Do you mean, fig=plt.figure(figsize=figsize), and then ax=fig.add_subplot,.. and ax.plot , etc?","created_at":"2016-10-17T17:45:25Z","updated_at":"2016-10-17T17:45:25Z","html_url":"https://github.com/matplotlib/matplotlib/pull/7294#discussion_r83696123","pull_request_url":"https://api.github.com/repos/matplotlib/matplotlib/pulls/7294","_links":{"self":{"href":"https://api.github.com/repos/matplotlib/matplotlib/pulls/comments/83696123"},"html":{"href":"https://github.com/matplotlib/matplotlib/pull/7294#discussion_r83696123"},"pull_request":{"href":"https://api.github.com/repos/matplotlib/matplotlib/pulls/7294"}}},"pull_request":{"url":"https://api.github.com/repos/matplotlib/matplotlib/pulls/7294","id":89665209,"html_url":"https://github.com/matplotlib/matplotlib/pull/7294","diff_url":"https://github.com/matplotlib/matplotlib/pull/7294.diff","patch_url":"https://github.com/matplotlib/matplotlib/pull/7294.patch","issue_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/7294","number":7294,"state":"open","locked":false,"title":"Added ArbitaryNorm and RootNorm classes in colors","user":{"login":"alvarosg","id":12649253,"avatar_url":"https://avatars.githubusercontent.com/u/12649253?v=3","gravatar_id":"","url":"https://api.github.com/users/alvarosg","html_url":"https://github.com/alvarosg","followers_url":"https://api.github.com/users/alvarosg/followers","following_url":"https://api.github.com/users/alvarosg/following{/other_user}","gists_url":"https://api.github.com/users/alvarosg/gists{/gist_id}","starred_url":"https://api.github.com/users/alvarosg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alvarosg/subscriptions","organizations_url":"https://api.github.com/users/alvarosg/orgs","repos_url":"https://api.github.com/users/alvarosg/repos","events_url":"https://api.github.com/users/alvarosg/events{/privacy}","received_events_url":"https://api.github.com/users/alvarosg/received_events","type":"User","site_admin":false},"body":"\"ArbitraryNorm\" is a class built on the class \"Normalize\" that provides a much easier way to create arbitrary non linear normalization, for both the positive and negative directions independently. This is achieved by passing a pair of non linear functions (and their inverse) as an argument in the constructor. This two functions will be used to independently normalise the positive and negative data, into the [0,1] range. It also allows fixing the value of the colormap that will be used for zero, letting the user decided which fraction of the colorbar ([0,1] range) they want to use for the positive and negative range, effectively letting the used fixing the color assigned to the zero value, even for non symmetric intervals.\r\n\r\nIn includes similar versions specialized in the positive-only and negative-only directions.\r\n\r\nThere are also classes built inheriting from the \"ArbitraryNorm\" classes, implementing a root normalization, by indicating just the degree of the root for the positive and the negative range.\r\n\r\nOverall this classes, as they are much more powerful, and allow much more control over the intervals. make the existing class \"PowerNorm\" obsolete.\r\n\r\nExamples of use are also included.\r\n","created_at":"2016-10-17T17:15:50Z","updated_at":"2016-10-17T17:45:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6c38c6460fb542733699011f159634f2479966c5","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/matplotlib/matplotlib/pulls/7294/commits","review_comments_url":"https://api.github.com/repos/matplotlib/matplotlib/pulls/7294/comments","review_comment_url":"https://api.github.com/repos/matplotlib/matplotlib/pulls/comments{/number}","comments_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/7294/comments","statuses_url":"https://api.github.com/repos/matplotlib/matplotlib/statuses/1d55f0cdd5b46a1d5d54384cdd5c552ef1f9b3ab","head":{"label":"alvarosg:arbitrary-norm","ref":"arbitrary-norm","sha":"1d55f0cdd5b46a1d5d54384cdd5c552ef1f9b3ab","user":{"login":"alvarosg","id":12649253,"avatar_url":"https://avatars.githubusercontent.com/u/12649253?v=3","gravatar_id":"","url":"https://api.github.com/users/alvarosg","html_url":"https://github.com/alvarosg","followers_url":"https://api.github.com/users/alvarosg/followers","following_url":"https://api.github.com/users/alvarosg/following{/other_user}","gists_url":"https://api.github.com/users/alvarosg/gists{/gist_id}","starred_url":"https://api.github.com/users/alvarosg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alvarosg/subscriptions","organizations_url":"https://api.github.com/users/alvarosg/orgs","repos_url":"https://api.github.com/users/alvarosg/repos","events_url":"https://api.github.com/users/alvarosg/events{/privacy}","received_events_url":"https://api.github.com/users/alvarosg/received_events","type":"User","site_admin":false},"repo":{"id":71148616,"name":"matplotlib","full_name":"alvarosg/matplotlib","owner":{"login":"alvarosg","id":12649253,"avatar_url":"https://avatars.githubusercontent.com/u/12649253?v=3","gravatar_id":"","url":"https://api.github.com/users/alvarosg","html_url":"https://github.com/alvarosg","followers_url":"https://api.github.com/users/alvarosg/followers","following_url":"https://api.github.com/users/alvarosg/following{/other_user}","gists_url":"https://api.github.com/users/alvarosg/gists{/gist_id}","starred_url":"https://api.github.com/users/alvarosg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alvarosg/subscriptions","organizations_url":"https://api.github.com/users/alvarosg/orgs","repos_url":"https://api.github.com/users/alvarosg/repos","events_url":"https://api.github.com/users/alvarosg/events{/privacy}","received_events_url":"https://api.github.com/users/alvarosg/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/alvarosg/matplotlib","description":"matplotlib: plotting with Python","fork":true,"url":"https://api.github.com/repos/alvarosg/matplotlib","forks_url":"https://api.github.com/repos/alvarosg/matplotlib/forks","keys_url":"https://api.github.com/repos/alvarosg/matplotlib/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alvarosg/matplotlib/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alvarosg/matplotlib/teams","hooks_url":"https://api.github.com/repos/alvarosg/matplotlib/hooks","issue_events_url":"https://api.github.com/repos/alvarosg/matplotlib/issues/events{/number}","events_url":"https://api.github.com/repos/alvarosg/matplotlib/events","assignees_url":"https://api.github.com/repos/alvarosg/matplotlib/assignees{/user}","branches_url":"https://api.github.com/repos/alvarosg/matplotlib/branches{/branch}","tags_url":"https://api.github.com/repos/alvarosg/matplotlib/tags","blobs_url":"https://api.github.com/repos/alvarosg/matplotlib/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alvarosg/matplotlib/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alvarosg/matplotlib/git/refs{/sha}","trees_url":"https://api.github.com/repos/alvarosg/matplotlib/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alvarosg/matplotlib/statuses/{sha}","languages_url":"https://api.github.com/repos/alvarosg/matplotlib/languages","stargazers_url":"https://api.github.com/repos/alvarosg/matplotlib/stargazers","contributors_url":"https://api.github.com/repos/alvarosg/matplotlib/contributors","subscribers_url":"https://api.github.com/repos/alvarosg/matplotlib/subscribers","subscription_url":"https://api.github.com/repos/alvarosg/matplotlib/subscription","commits_url":"https://api.github.com/repos/alvarosg/matplotlib/commits{/sha}","git_commits_url":"https://api.github.com/repos/alvarosg/matplotlib/git/commits{/sha}","comments_url":"https://api.github.com/repos/alvarosg/matplotlib/comments{/number}","issue_comment_url":"https://api.github.com/repos/alvarosg/matplotlib/issues/comments{/number}","contents_url":"https://api.github.com/repos/alvarosg/matplotlib/contents/{+path}","compare_url":"https://api.github.com/repos/alvarosg/matplotlib/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alvarosg/matplotlib/merges","archive_url":"https://api.github.com/repos/alvarosg/matplotlib/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alvarosg/matplotlib/downloads","issues_url":"https://api.github.com/repos/alvarosg/matplotlib/issues{/number}","pulls_url":"https://api.github.com/repos/alvarosg/matplotlib/pulls{/number}","milestones_url":"https://api.github.com/repos/alvarosg/matplotlib/milestones{/number}","notifications_url":"https://api.github.com/repos/alvarosg/matplotlib/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alvarosg/matplotlib/labels{/name}","releases_url":"https://api.github.com/repos/alvarosg/matplotlib/releases{/id}","deployments_url":"https://api.github.com/repos/alvarosg/matplotlib/deployments","created_at":"2016-10-17T14:43:32Z","updated_at":"2016-10-17T14:43:42Z","pushed_at":"2016-10-17T17:03:05Z","git_url":"git://github.com/alvarosg/matplotlib.git","ssh_url":"git@github.com:alvarosg/matplotlib.git","clone_url":"https://github.com/alvarosg/matplotlib.git","svn_url":"https://github.com/alvarosg/matplotlib","homepage":"http://matplotlib.org/","size":400276,"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":"e24322cfb0b7c7b94078099dc6ccae047a70936a","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-10-17T17:34:07Z","pushed_at":"2016-10-17T17:15:50Z","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":400345,"stargazers_count":4236,"watchers_count":4236,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2080,"mirror_url":null,"open_issues_count":1026,"forks":2080,"open_issues":1026,"watchers":4236,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/matplotlib/matplotlib/pulls/7294"},"html":{"href":"https://github.com/matplotlib/matplotlib/pull/7294"},"issue":{"href":"https://api.github.com/repos/matplotlib/matplotlib/issues/7294"},"comments":{"href":"https://api.github.com/repos/matplotlib/matplotlib/issues/7294/comments"},"review_comments":{"href":"https://api.github.com/repos/matplotlib/matplotlib/pulls/7294/comments"},"review_comment":{"href":"https://api.github.com/repos/matplotlib/matplotlib/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/matplotlib/matplotlib/pulls/7294/commits"},"statuses":{"href":"https://api.github.com/repos/matplotlib/matplotlib/statuses/1d55f0cdd5b46a1d5d54384cdd5c552ef1f9b3ab"}}}}
{"actor":{"display_login":"alvarosg"}}