Title: autoscale_view is not working with Line3DCollection · Issue #17130 · matplotlib/matplotlib · GitHub
Open Graph Title: autoscale_view is not working with Line3DCollection · Issue #17130 · matplotlib/matplotlib
X Title: autoscale_view is not working with Line3DCollection · Issue #17130 · matplotlib/matplotlib
Description: Bug report Bug summary I found multiple issues of autoscale_view for Line3DCollection that autoscale_view takes no effect for plots with Line3DCollection. autoscale_view even breaks the original bounds and forces it to be a unit cube if ...
Open Graph Description: Bug report Bug summary I found multiple issues of autoscale_view for Line3DCollection that autoscale_view takes no effect for plots with Line3DCollection. autoscale_view even breaks the original bo...
X Description: Bug report Bug summary I found multiple issues of autoscale_view for Line3DCollection that autoscale_view takes no effect for plots with Line3DCollection. autoscale_view even breaks the original bo...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/17130
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"autoscale_view is not working with Line3DCollection","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\nI found multiple issues of `autoscale_view` for `Line3DCollection` that \r\n1. `autoscale_view` takes no effect for plots with `Line3DCollection`.\r\n2. `autoscale_view` even breaks the original bounds and forces it to be a unit cube if it is used with `ax.set_autoscale_on(True)`.\r\n\r\nThis is reported from the downstream issue https://github.com/sympy/sympy/issues/19106 \r\n\r\n**Code for reproduction**\r\n\r\n\u003c!--A minimum code snippet required to reproduce the bug.\r\nPlease make sure to minimize the number of dependencies required, and provide\r\nany necessary plotted data.\r\nAvoid using threads, as Matplotlib is (explicitly) not thread-safe.--\u003e\r\n\r\n```python\r\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\nfrom mpl_toolkits.mplot3d import Axes3D\r\nfrom mpl_toolkits.mplot3d.art3d import Line3DCollection\r\n\r\nz = np.linspace(-4 * np.pi, 4 * np.pi, 100)\r\nx = np.sin(z)\r\ny = np.cos(z)\r\n\r\nsegments = []\r\nfor i in range(len(z)-1):\r\n z0, x0, y0 = z[i], x[i], y[i]\r\n z1, x1, y1 = z[i+1], x[i+1], y[i+1]\r\n segments.append([(x0, y0, z0), (x1, y1, z1)])\r\n\r\ncollection = Line3DCollection(segments)\r\nfig = plt.figure()\r\nax = fig.gca(projection='3d')\r\n\r\nax.add_collection3d(collection)\r\nax.set_xlim3d(-1, 1)\r\nax.set_ylim3d(-1, 1)\r\nax.set_zlim3d(-4*np.pi, 4*np.pi)\r\nax.set_autoscale_on(True)\r\nax.autoscale_view()\r\nplt.show()\r\n```\r\n\r\n**Actual outcome**\r\n\r\n\u003c!--The output produced by the above code, which may be a screenshot, console output, etc.--\u003e\r\n\r\n\r\n\r\n\r\n**Expected outcome**\r\n\r\n\r\n\r\n\r\n\u003c!--A description of the expected outcome from the code snippet--\u003e\r\n\u003c!--If this used to work in an earlier version of Matplotlib, please note the version it used to work on--\u003e\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:\r\n * Matplotlib version: 3.2\r\n * Matplotlib backend (`print(matplotlib.get_backend())`): module://ipykernel.pylab.backend_inline\r\n * Python version: 3.7.7\r\n * Jupyter version (if applicable):\r\n * Other libraries: \r\n\r\n\u003c!--Please tell us how you installed matplotlib and python e.g., from source, pip, conda--\u003e\r\n\u003c!--If you installed from conda, please specify which channel you used if not the default--\u003e\r\n\r\n","author":{"url":"https://github.com/sylee957","@type":"Person","name":"sylee957"},"datePublished":"2020-04-14T01:43:09.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/17130/matplotlib/issues/17130"}
| 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:7d877d30-1e75-7d3d-3847-efe5c73f667c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A864:135646:E6D1FA:136F69F:6A52D178 |
| html-safe-nonce | 93b381912efaa35fbf17e24462d7c07c8b20c493d30d40eb33487b7c36c4776f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBODY0OjEzNTY0NjpFNkQxRkE6MTM2RjY5Rjo2QTUyRDE3OCIsInZpc2l0b3JfaWQiOiIzNzY2MTk0ODE3MjAzMzYwMTIwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 887e533ef85525e681c759ab84fe732e7eca56ae0533c1443feb4c6355ef2f7e |
| hovercard-subject-tag | issue:599237148 |
| 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/17130/issue_layout |
| twitter:image | https://opengraph.githubassets.com/98a6c40f74385a71b032244e2be4796b1b4953dc13f36e6fa479dc8498344d1f/matplotlib/matplotlib/issues/17130 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/98a6c40f74385a71b032244e2be4796b1b4953dc13f36e6fa479dc8498344d1f/matplotlib/matplotlib/issues/17130 |
| og:image:alt | Bug report Bug summary I found multiple issues of autoscale_view for Line3DCollection that autoscale_view takes no effect for plots with Line3DCollection. autoscale_view even breaks the original bo... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | sylee957 |
| 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