{"action":"created","issue":{"url":"https://api.github.com/repos/matplotlib/matplotlib/issues/6404","repository_url":"https://api.github.com/repos/matplotlib/matplotlib","labels_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/6404/labels{/name}","comments_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/6404/comments","events_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/6404/events","html_url":"https://github.com/matplotlib/matplotlib/pull/6404","id":154332904,"number":6404,"title":"Add a ax.voxels(bool3d) function","user":{"login":"eric-wieser","id":425260,"avatar_url":"https://avatars7.githubusercontent.com/u/425260?v=4","gravatar_id":"","url":"https://api.github.com/users/eric-wieser","html_url":"https://github.com/eric-wieser","followers_url":"https://api.github.com/users/eric-wieser/followers","following_url":"https://api.github.com/users/eric-wieser/following{/other_user}","gists_url":"https://api.github.com/users/eric-wieser/gists{/gist_id}","starred_url":"https://api.github.com/users/eric-wieser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eric-wieser/subscriptions","organizations_url":"https://api.github.com/users/eric-wieser/orgs","repos_url":"https://api.github.com/users/eric-wieser/repos","events_url":"https://api.github.com/users/eric-wieser/events{/privacy}","received_events_url":"https://api.github.com/users/eric-wieser/received_events","type":"User","site_admin":false},"labels":[{"id":116757,"url":"https://api.github.com/repos/matplotlib/matplotlib/labels/mplot3d","name":"mplot3d","color":"02e10c","default":false},{"id":84780976,"url":"https://api.github.com/repos/matplotlib/matplotlib/labels/needs_review","name":"needs_review","color":"009800","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/matplotlib/matplotlib/milestones/12","html_url":"https://github.com/matplotlib/matplotlib/milestone/12","labels_url":"https://api.github.com/repos/matplotlib/matplotlib/milestones/12/labels","id":534144,"number":12,"title":"2.1 (next point release)","description":"Next feature release.\r\n\r\nBig ticket items:\r\n\r\n - MEP 22/27\r\n - traitlets","creator":{"login":"tacaswell","id":199813,"avatar_url":"https://avatars7.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":650,"closed_issues":1019,"state":"open","created_at":"2014-01-13T03:21:09Z","updated_at":"2017-07-15T22:57:37Z","due_on":null,"closed_at":null},"comments":40,"created_at":"2016-05-11T20:16:08Z","updated_at":"2017-07-16T12:42:20Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/matplotlib/matplotlib/pulls/6404","html_url":"https://github.com/matplotlib/matplotlib/pull/6404","diff_url":"https://github.com/matplotlib/matplotlib/pull/6404.diff","patch_url":"https://github.com/matplotlib/matplotlib/pull/6404.patch"},"body":"I found myself needing a voxel plot to visualize a subset of RGB space, and thought that the plot was sufficiently useful that it would do well to belong upstream.\r\n\r\nI'm not convinced the argument choices I've made line up too well with the rest of matplotlib, so I'd appreciate feedback on what I should be parameterizing this with.\r\n\r\n``` python\r\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\nfrom mpl_toolkits.mplot3d import Axes3D\r\n```\r\n\r\nPlotting a simple boolean array\r\n\r\n``` python\r\nfig = plt.figure()\r\nax = fig.add_subplot(111, projection='3d')\r\n\r\nx, y, z = np.indices((10, 10, 10))\r\nvoxels = (x == y) | (y == z)\r\nax.voxels(voxels)\r\n\r\nplt.show()\r\n```\r\n\r\n![image](https://cloud.githubusercontent.com/assets/425260/15194973/a8db3338-1793-11e6-82a1-564732410d2b.png)\r\n\r\nAttaching color information\r\n\r\n``` python\r\nfig = plt.figure()\r\nax = fig.add_subplot(111, projection='3d')\r\n\r\nx, y, z = np.indices((10, 10, 10))\r\nvoxels = (x == y) | (y == z)\r\ncolors = np.zeros((10, 10, 10), dtype=np.object_)\r\ncolors.fill('b')\r\ncolors[(x<5) & (y < 5)] =  'r'\r\ncolors[(x + z) < 10] =  'g'\r\nax.voxels(voxels, colors)\r\n\r\nplt.show()\r\n```\r\n\r\n![image](https://cloud.githubusercontent.com/assets/425260/15195110/590f7002-1794-11e6-9a46-4b3ae98b9069.png)\r\n## Possible improvements:\r\n- <s>Allow control of origin, scale, and rotation - possibly a `transform` argument of a `(3,4)` matrix?</s> Done via `x, y z` arguments!\r\n- `cmap` support\r\n- `np.ma.array` variant that omits the `filled` argument\r\n- <s>Return something sensible</s> Done by returning a dict keyed by coordinate\r\n"},"comment":{"url":"https://api.github.com/repos/matplotlib/matplotlib/issues/comments/315606704","html_url":"https://github.com/matplotlib/matplotlib/pull/6404#issuecomment-315606704","issue_url":"https://api.github.com/repos/matplotlib/matplotlib/issues/6404","id":315606704,"user":{"login":"eric-wieser","id":425260,"avatar_url":"https://avatars7.githubusercontent.com/u/425260?v=4","gravatar_id":"","url":"https://api.github.com/users/eric-wieser","html_url":"https://github.com/eric-wieser","followers_url":"https://api.github.com/users/eric-wieser/followers","following_url":"https://api.github.com/users/eric-wieser/following{/other_user}","gists_url":"https://api.github.com/users/eric-wieser/gists{/gist_id}","starred_url":"https://api.github.com/users/eric-wieser/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eric-wieser/subscriptions","organizations_url":"https://api.github.com/users/eric-wieser/orgs","repos_url":"https://api.github.com/users/eric-wieser/repos","events_url":"https://api.github.com/users/eric-wieser/events{/privacy}","received_events_url":"https://api.github.com/users/eric-wieser/received_events","type":"User","site_admin":false},"created_at":"2017-07-16T12:42:20Z","updated_at":"2017-07-16T12:42:20Z","body":"Yeah, I disagree with this:\r\n\r\n> ```\r\n> /home/travis/build/matplotlib/matplotlib/lib/mpl_toolkits/mplot3d/axes3d.py:2813:9: E731 do not assign a lambda expression, use a def\r\n>         _get_args = lambda filled, **kwargs: (filled, kwargs)\r\n> ```\r\n\r\nThe whole reason I switched to a lambda there is the PEP8 was making me insert unhelpful whitespace."}}
{"actor":{"display_login":"eric-wieser"}}