Title: Calling invert_yaxis() on a 3D plot has either no effect or removes ticks · Issue #14577 · matplotlib/matplotlib · GitHub
Open Graph Title: Calling invert_yaxis() on a 3D plot has either no effect or removes ticks · Issue #14577 · matplotlib/matplotlib
X Title: Calling invert_yaxis() on a 3D plot has either no effect or removes ticks · Issue #14577 · matplotlib/matplotlib
Description: Bug report Bug summary Using version 3.1.0, ax.invert_yaxis() does not work as expected when called on a 3D scatter plot. There seems to be no effect when it is called after populating the plot, while calling it before the plot inverts t...
Open Graph Description: Bug report Bug summary Using version 3.1.0, ax.invert_yaxis() does not work as expected when called on a 3D scatter plot. There seems to be no effect when it is called after populating the plot, wh...
X Description: Bug report Bug summary Using version 3.1.0, ax.invert_yaxis() does not work as expected when called on a 3D scatter plot. There seems to be no effect when it is called after populating the plot, wh...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/14577
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Calling invert_yaxis() on a 3D plot has either no effect or removes ticks","articleBody":"\u003c!--To help us understand and resolve your issue, please fill out the form to the best of your ability.--\u003e\r\n\u003c!--You can feel free to delete the sections that do not apply.--\u003e\r\n\r\n### Bug report\r\n\r\n**Bug summary**\r\n\r\nUsing version 3.1.0, ax.invert_yaxis() does not work as expected when called on a 3D scatter plot. There seems to be no effect when it is called after populating the plot, while calling it before the plot inverts the data points correctly but moves all ticks to one point. \r\n\r\n**Code for reproduction**\r\n\r\n```python\r\n# Version 1: calling invert_yaxis() after populating the plot.\r\n# Version 2 (omitted): calling invert_yaxis() after ax = fig.add_subplot(111, projection='3d')\r\n# Using the official 3D scatter plot example. \r\n\r\nfrom mpl_toolkits.mplot3d import Axes3D \r\n\r\nimport matplotlib.pyplot as plt\r\nimport numpy as np\r\n\r\nnp.random.seed(19680801)\r\n\r\ndef randrange(n, vmin, vmax):\r\n '''\r\n Helper function to make an array of random numbers having shape (n, )\r\n with each number distributed Uniform(vmin, vmax).\r\n '''\r\n return (vmax - vmin)*np.random.rand(n) + vmin\r\n\r\nfig = plt.figure()\r\nax = fig.add_subplot(111, projection='3d')\r\n\r\nn = 100\r\n\r\n# For each set of style and range settings, plot n random points in the box\r\n# defined by x in [23, 32], y in [0, 100], z in [zlow, zhigh].\r\nfor m, zlow, zhigh in [('o', -50, -25), ('^', -30, -5)]:\r\n xs = randrange(n, 23, 32)\r\n ys = randrange(n, 0, 100)\r\n zs = randrange(n, zlow, zhigh)\r\n ax.scatter(xs, ys, zs, marker=m)\r\n\r\nax.invert_yaxis()\r\nax.set_xlabel('X Label')\r\nax.set_ylabel('Y Label')\r\nax.set_zlabel('Z Label')\r\n\r\nplt.show()\r\n```\r\n\r\n**Actual outcome when inverting axis after populating plot:**\r\n\r\n\r\n\r\n**Actual outcome when inverting axis before populating plot:**\r\n\r\n\r\n\r\n**Expected outcome**\r\n\r\nUsing ax.set_ylim(105,-5):\r\n\r\n\r\n\r\n**Matplotlib version**\r\n\u003c!--Please specify your platform and versions of the relevant libraries you are using:--\u003e\r\n * Operating system: Ubuntu 18.04.2\r\n * Matplotlib version: 3.1.0\r\n * Matplotlib backend (`print(matplotlib.get_backend())`): TkAgg\r\n * Python version: 3.6.8\r\n * Jupyter version (if applicable):\r\n * Other libraries: Numpy 1.16.1\r\n\r\nMatplotlib and Python were installed with pip.\r\n\r\n\u003chr\u003e\r\n\r\nAlso posted on SO, https://stackoverflow.com/questions/56666916/inverting-axis-of-matplotlib-3d-plot-ruins-ticks","author":{"url":"https://github.com/ffaallkk","@type":"Person","name":"ffaallkk"},"datePublished":"2019-06-19T12:25:48.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":6},"url":"https://github.com/14577/matplotlib/issues/14577"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:5543db0b-0d24-e5af-57a1-6c006b5fa4d4 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 91C8:2C9FC7:2925F3C:374FF22:6A53A77E |
| html-safe-nonce | 69d94d8bdb115f2521e565e05396809a2934a1c806cf5a05de8be07ceb91f8fd |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MUM4OjJDOUZDNzoyOTI1RjNDOjM3NEZGMjI6NkE1M0E3N0UiLCJ2aXNpdG9yX2lkIjoiMTg1MzYyMTc4MTIzMzExNzA1NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 4f320b56efbbd8d93645762c1f6fa650aa555990ba39c1472564c20ab0dcab42 |
| hovercard-subject-tag | issue:457983084 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/matplotlib/matplotlib/14577/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e7c2def07db005d71bfa4a4a29ecdba6918b8f2db8f32690fce522b5984a1076/matplotlib/matplotlib/issues/14577 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e7c2def07db005d71bfa4a4a29ecdba6918b8f2db8f32690fce522b5984a1076/matplotlib/matplotlib/issues/14577 |
| og:image:alt | Bug report Bug summary Using version 3.1.0, ax.invert_yaxis() does not work as expected when called on a 3D scatter plot. There seems to be no effect when it is called after populating the plot, wh... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ffaallkk |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| go-import | github.com/matplotlib/matplotlib git https://github.com/matplotlib/matplotlib.git |
| octolytics-dimension-user_id | 215947 |
| octolytics-dimension-user_login | matplotlib |
| octolytics-dimension-repository_id | 1385122 |
| octolytics-dimension-repository_nwo | matplotlib/matplotlib |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1385122 |
| octolytics-dimension-repository_network_root_nwo | matplotlib/matplotlib |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 07a982c1d40157c619b364352b704c3ce66bb332 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width