payload: {"action":"opened","number":348,"pull_request":{"url":"https://api.github.com/repos/pyvista/pyvista/pulls/348","id":303973462,"node_id":"MDExOlB1bGxSZXF1ZXN0MzAzOTczNDYy","html_url":"https://github.com/pyvista/pyvista/pull/348","diff_url":"https://github.com/pyvista/pyvista/pull/348.diff","patch_url":"https://github.com/pyvista/pyvista/pull/348.patch","issue_url":"https://api.github.com/repos/pyvista/pyvista/issues/348","number":348,"state":"open","locked":false,"title":"Labelled Scalar bars","user":{"login":"banesullivan","id":22067021,"node_id":"MDQ6VXNlcjIyMDY3MDIx","avatar_url":"https://avatars2.githubusercontent.com/u/22067021?v=4","gravatar_id":"","url":"https://api.github.com/users/banesullivan","html_url":"https://github.com/banesullivan","followers_url":"https://api.github.com/users/banesullivan/followers","following_url":"https://api.github.com/users/banesullivan/following{/other_user}","gists_url":"https://api.github.com/users/banesullivan/gists{/gist_id}","starred_url":"https://api.github.com/users/banesullivan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/banesullivan/subscriptions","organizations_url":"https://api.github.com/users/banesullivan/orgs","repos_url":"https://api.github.com/users/banesullivan/repos","events_url":"https://api.github.com/users/banesullivan/events{/privacy}","received_events_url":"https://api.github.com/users/banesullivan/received_events","type":"User","site_admin":false},"body":"Resolve #298 \r\nRelevant to #200 and https://github.com/pyvista/pyvista-support/issues/25\r\n\r\nThis PR updates functionality with the scalar bar to support annotations and categorical, labeled scalar bars.\r\n\r\n\r\n\r\n## Annotatations\r\n\r\nNow you can annotate specific values, NaN values, and values above/below the scalar range\r\n\r\nSet up:\r\n```py\r\nimport pyvista as pv\r\nfrom pyvista import examples\r\npv.set_plot_theme('doc')\r\nimport numpy as np\r\n\r\nmesh = examples.download_st_helens().warp_by_scalar().extract_surface()\r\n```\r\n\r\n### Below/Above Range\r\n\r\nWhen setting the scalar bar range via the `clim` argument, you can pass `below_color` and `above_color` to color values below/above that range as desired:\r\n\r\n```py\r\np = pv.Plotter()\r\np.add_mesh(mesh, clim=[1000, 2000],\r\n           below_color='blue', above_color='red',\r\n           scalar_bar_args=sargs)\r\np.show()\r\n```\r\n\r\n![sphx_glr_scalar-bars_004](https://user-images.githubusercontent.com/22067021/62406603-c6073500-b56b-11e9-9d1e-41a06af600bd.png)\r\n\r\n\r\n### NaN values\r\n\r\nLabel the `nan_color` by passing `nan_annotation=True` in the `scalar_bar_args`\r\n\r\n```py\r\ninds = np.logical_and(mesh['Elevation'] < 1500, mesh['Elevation'] > 1300)\r\nmesh['withnans'] = mesh['Elevation'].copy()\r\nmesh['withnans'][inds] = np.nan\r\n\r\nmesh.plot(scalars='withnans', nan_color='grey', \r\n          scalar_bar_args=dict(nan_annotation=True))\r\n```\r\n\r\n![download](https://user-images.githubusercontent.com/22067021/62406698-e5eb2880-b56c-11e9-9533-4d9874d9eb90.png)\r\n\r\n\r\n### Specific values\r\n\r\nPass a set of annotations as a dictionary (key is label, value it float number to annotate) to label specific values on the scalar bar:\r\n\r\n```py\r\n# Make a dictionary for the annotations\r\nannotations = {\r\n    \"High\" : 2300,\r\n    'Cutoff value': 800,\r\n}\r\n\r\np = pv.Plotter()\r\np.add_mesh(mesh, scalars='Elevation', annotations=annotations)\r\np.show()\r\n```\r\n![sphx_glr_scalar-bars_005](https://user-images.githubusercontent.com/22067021/62406612-e0d9a980-b56b-11e9-8d35-f8d568dd95a3.png)\r\n\r\n\r\n\r\n## Categorical Arrays (string arrays)\r\n\r\nNow automatically plot and label string categorical data arrays (see #298)\r\n\r\n(We need a better example for this)\r\n\r\n```py\r\n# Creste string array\r\nnmag = np.sum(mesh.compute_normals()['Normals'], axis=1)\r\nlabels = np.empty(len(nmag), dtype='<U10')\r\nlabels[:] = 'High'\r\nlabels[nmag < 1] = 'Medium'\r\nlabels[nmag < 0.7] = 'Low'\r\n\r\nmesh['labels'] = labels\r\nmesh.plot(scalars='labels')\r\n```\r\n\r\n![download](https://user-images.githubusercontent.com/22067021/62406629-2bf3bc80-b56c-11e9-9f43-7db7cb3f1124.png)","created_at":"2019-08-03T03:35:23Z","updated_at":"2019-08-03T03:35:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/pyvista/pyvista/pulls/348/commits","review_comments_url":"https://api.github.com/repos/pyvista/pyvista/pulls/348/comments","review_comment_url":"https://api.github.com/repos/pyvista/pyvista/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pyvista/pyvista/issues/348/comments","statuses_url":"https://api.github.com/repos/pyvista/pyvista/statuses/0f426f8efbc327be1dab48b711cdd6c9cc2bfb33","head":{"label":"pyvista:scalar-bars","ref":"scalar-bars","sha":"0f426f8efbc327be1dab48b711cdd6c9cc2bfb33","user":{"login":"pyvista","id":50384771,"node_id":"MDEyOk9yZ2FuaXphdGlvbjUwMzg0Nzcx","avatar_url":"https://avatars3.githubusercontent.com/u/50384771?v=4","gravatar_id":"","url":"https://api.github.com/users/pyvista","html_url":"https://github.com/pyvista","followers_url":"https://api.github.com/users/pyvista/followers","following_url":"https://api.github.com/users/pyvista/following{/other_user}","gists_url":"https://api.github.com/users/pyvista/gists{/gist_id}","starred_url":"https://api.github.com/users/pyvista/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pyvista/subscriptions","organizations_url":"https://api.github.com/users/pyvista/orgs","repos_url":"https://api.github.com/users/pyvista/repos","events_url":"https://api.github.com/users/pyvista/events{/privacy}","received_events_url":"https://api.github.com/users/pyvista/received_events","type":"Organization","site_admin":false},"repo":{"id":92974124,"node_id":"MDEwOlJlcG9zaXRvcnk5Mjk3NDEyNA==","name":"pyvista","full_name":"pyvista/pyvista","private":false,"owner":{"login":"pyvista","id":50384771,"node_id":"MDEyOk9yZ2FuaXphdGlvbjUwMzg0Nzcx","avatar_url":"https://avatars3.githubusercontent.com/u/50384771?v=4","gravatar_id":"","url":"https://api.github.com/users/pyvista","html_url":"https://github.com/pyvista","followers_url":"https://api.github.com/users/pyvista/followers","following_url":"https://api.github.com/users/pyvista/following{/other_user}","gists_url":"https://api.github.com/users/pyvista/gists{/gist_id}","starred_url":"https://api.github.com/users/pyvista/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pyvista/subscriptions","organizations_url":"https://api.github.com/users/pyvista/orgs","repos_url":"https://api.github.com/users/pyvista/repos","events_url":"https://api.github.com/users/pyvista/events{/privacy}","received_events_url":"https://api.github.com/users/pyvista/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/pyvista/pyvista","description":"3D plotting and mesh analysis through a streamlined interface for the Visualization Toolkit (VTK)","fork":false,"url":"https://api.github.com/repos/pyvista/pyvista","forks_url":"https://api.github.com/repos/pyvista/pyvista/forks","keys_url":"https://api.github.com/repos/pyvista/pyvista/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pyvista/pyvista/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pyvista/pyvista/teams","hooks_url":"https://api.github.com/repos/pyvista/pyvista/hooks","issue_events_url":"https://api.github.com/repos/pyvista/pyvista/issues/events{/number}","events_url":"https://api.github.com/repos/pyvista/pyvista/events","assignees_url":"https://api.github.com/repos/pyvista/pyvista/assignees{/user}","branches_url":"https://api.github.com/repos/pyvista/pyvista/branches{/branch}","tags_url":"https://api.github.com/repos/pyvista/pyvista/tags","blobs_url":"https://api.github.com/repos/pyvista/pyvista/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pyvista/pyvista/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pyvista/pyvista/git/refs{/sha}","trees_url":"https://api.github.com/repos/pyvista/pyvista/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pyvista/pyvista/statuses/{sha}","languages_url":"https://api.github.com/repos/pyvista/pyvista/languages","stargazers_url":"https://api.github.com/repos/pyvista/pyvista/stargazers","contributors_url":"https://api.github.com/repos/pyvista/pyvista/contributors","subscribers_url":"https://api.github.com/repos/pyvista/pyvista/subscribers","subscription_url":"https://api.github.com/repos/pyvista/pyvista/subscription","commits_url":"https://api.github.com/repos/pyvista/pyvista/commits{/sha}","git_commits_url":"https://api.github.com/repos/pyvista/pyvista/git/commits{/sha}","comments_url":"https://api.github.com/repos/pyvista/pyvista/comments{/number}","issue_comment_url":"https://api.github.com/repos/pyvista/pyvista/issues/comments{/number}","contents_url":"https://api.github.com/repos/pyvista/pyvista/contents/{+path}","compare_url":"https://api.github.com/repos/pyvista/pyvista/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pyvista/pyvista/merges","archive_url":"https://api.github.com/repos/pyvista/pyvista/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pyvista/pyvista/downloads","issues_url":"https://api.github.com/repos/pyvista/pyvista/issues{/number}","pulls_url":"https://api.github.com/repos/pyvista/pyvista/pulls{/number}","milestones_url":"https://api.github.com/repos/pyvista/pyvista/milestones{/number}","notifications_url":"https://api.github.com/repos/pyvista/pyvista/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pyvista/pyvista/labels{/name}","releases_url":"https://api.github.com/repos/pyvista/pyvista/releases{/id}","deployments_url":"https://api.github.com/repos/pyvista/pyvista/deployments","created_at":"2017-05-31T18:01:42Z","updated_at":"2019-08-02T16:05:31Z","pushed_at":"2019-08-03T03:16:35Z","git_url":"git://github.com/pyvista/pyvista.git","ssh_url":"git@github.com:pyvista/pyvista.git","clone_url":"https://github.com/pyvista/pyvista.git","svn_url":"https://github.com/pyvista/pyvista","homepage":"http://docs.pyvista.org/","size":97816,"stargazers_count":174,"watchers_count":174,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":42,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":63,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":42,"open_issues":63,"watchers":174,"default_branch":"master"}},"base":{"label":"pyvista:master","ref":"master","sha":"e7ec9f0400529361b7b5cc0b0a59e7c6130e3e39","user":{"login":"pyvista","id":50384771,"node_id":"MDEyOk9yZ2FuaXphdGlvbjUwMzg0Nzcx","avatar_url":"https://avatars3.githubusercontent.com/u/50384771?v=4","gravatar_id":"","url":"https://api.github.com/users/pyvista","html_url":"https://github.com/pyvista","followers_url":"https://api.github.com/users/pyvista/followers","following_url":"https://api.github.com/users/pyvista/following{/other_user}","gists_url":"https://api.github.com/users/pyvista/gists{/gist_id}","starred_url":"https://api.github.com/users/pyvista/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pyvista/subscriptions","organizations_url":"https://api.github.com/users/pyvista/orgs","repos_url":"https://api.github.com/users/pyvista/repos","events_url":"https://api.github.com/users/pyvista/events{/privacy}","received_events_url":"https://api.github.com/users/pyvista/received_events","type":"Organization","site_admin":false},"repo":{"id":92974124,"node_id":"MDEwOlJlcG9zaXRvcnk5Mjk3NDEyNA==","name":"pyvista","full_name":"pyvista/pyvista","private":false,"owner":{"login":"pyvista","id":50384771,"node_id":"MDEyOk9yZ2FuaXphdGlvbjUwMzg0Nzcx","avatar_url":"https://avatars3.githubusercontent.com/u/50384771?v=4","gravatar_id":"","url":"https://api.github.com/users/pyvista","html_url":"https://github.com/pyvista","followers_url":"https://api.github.com/users/pyvista/followers","following_url":"https://api.github.com/users/pyvista/following{/other_user}","gists_url":"https://api.github.com/users/pyvista/gists{/gist_id}","starred_url":"https://api.github.com/users/pyvista/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pyvista/subscriptions","organizations_url":"https://api.github.com/users/pyvista/orgs","repos_url":"https://api.github.com/users/pyvista/repos","events_url":"https://api.github.com/users/pyvista/events{/privacy}","received_events_url":"https://api.github.com/users/pyvista/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/pyvista/pyvista","description":"3D plotting and mesh analysis through a streamlined interface for the Visualization Toolkit (VTK)","fork":false,"url":"https://api.github.com/repos/pyvista/pyvista","forks_url":"https://api.github.com/repos/pyvista/pyvista/forks","keys_url":"https://api.github.com/repos/pyvista/pyvista/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pyvista/pyvista/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pyvista/pyvista/teams","hooks_url":"https://api.github.com/repos/pyvista/pyvista/hooks","issue_events_url":"https://api.github.com/repos/pyvista/pyvista/issues/events{/number}","events_url":"https://api.github.com/repos/pyvista/pyvista/events","assignees_url":"https://api.github.com/repos/pyvista/pyvista/assignees{/user}","branches_url":"https://api.github.com/repos/pyvista/pyvista/branches{/branch}","tags_url":"https://api.github.com/repos/pyvista/pyvista/tags","blobs_url":"https://api.github.com/repos/pyvista/pyvista/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pyvista/pyvista/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pyvista/pyvista/git/refs{/sha}","trees_url":"https://api.github.com/repos/pyvista/pyvista/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pyvista/pyvista/statuses/{sha}","languages_url":"https://api.github.com/repos/pyvista/pyvista/languages","stargazers_url":"https://api.github.com/repos/pyvista/pyvista/stargazers","contributors_url":"https://api.github.com/repos/pyvista/pyvista/contributors","subscribers_url":"https://api.github.com/repos/pyvista/pyvista/subscribers","subscription_url":"https://api.github.com/repos/pyvista/pyvista/subscription","commits_url":"https://api.github.com/repos/pyvista/pyvista/commits{/sha}","git_commits_url":"https://api.github.com/repos/pyvista/pyvista/git/commits{/sha}","comments_url":"https://api.github.com/repos/pyvista/pyvista/comments{/number}","issue_comment_url":"https://api.github.com/repos/pyvista/pyvista/issues/comments{/number}","contents_url":"https://api.github.com/repos/pyvista/pyvista/contents/{+path}","compare_url":"https://api.github.com/repos/pyvista/pyvista/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pyvista/pyvista/merges","archive_url":"https://api.github.com/repos/pyvista/pyvista/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pyvista/pyvista/downloads","issues_url":"https://api.github.com/repos/pyvista/pyvista/issues{/number}","pulls_url":"https://api.github.com/repos/pyvista/pyvista/pulls{/number}","milestones_url":"https://api.github.com/repos/pyvista/pyvista/milestones{/number}","notifications_url":"https://api.github.com/repos/pyvista/pyvista/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pyvista/pyvista/labels{/name}","releases_url":"https://api.github.com/repos/pyvista/pyvista/releases{/id}","deployments_url":"https://api.github.com/repos/pyvista/pyvista/deployments","created_at":"2017-05-31T18:01:42Z","updated_at":"2019-08-02T16:05:31Z","pushed_at":"2019-08-03T03:16:35Z","git_url":"git://github.com/pyvista/pyvista.git","ssh_url":"git@github.com:pyvista/pyvista.git","clone_url":"https://github.com/pyvista/pyvista.git","svn_url":"https://github.com/pyvista/pyvista","homepage":"http://docs.pyvista.org/","size":97816,"stargazers_count":174,"watchers_count":174,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":42,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":63,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":42,"open_issues":63,"watchers":174,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pyvista/pyvista/pulls/348"},"html":{"href":"https://github.com/pyvista/pyvista/pull/348"},"issue":{"href":"https://api.github.com/repos/pyvista/pyvista/issues/348"},"comments":{"href":"https://api.github.com/repos/pyvista/pyvista/issues/348/comments"},"review_comments":{"href":"https://api.github.com/repos/pyvista/pyvista/pulls/348/comments"},"review_comment":{"href":"https://api.github.com/repos/pyvista/pyvista/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pyvista/pyvista/pulls/348/commits"},"statuses":{"href":"https://api.github.com/repos/pyvista/pyvista/statuses/0f426f8efbc327be1dab48b711cdd6c9cc2bfb33"}},"author_association":"MEMBER","merged":false,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"maintainer_can_modify":false,"commits":6,"additions":176,"deletions":24,"changed_files":6}}
other: {"actor":{"display_login":"banesullivan"}}