Title: get_datalim returns non-finite values for finite Line3DCollection · Issue #18197 · matplotlib/matplotlib · GitHub
Open Graph Title: get_datalim returns non-finite values for finite Line3DCollection · Issue #18197 · matplotlib/matplotlib
X Title: get_datalim returns non-finite values for finite Line3DCollection · Issue #18197 · matplotlib/matplotlib
Description: Bug report Bug summary Discovered whilst investigating #17130, the get_datalim method of Line3DCollection is returning inf values for a finite 3D line collection. Code for reproduction import matplotlib.pyplot as plt from matplotlib.coll...
Open Graph Description: Bug report Bug summary Discovered whilst investigating #17130, the get_datalim method of Line3DCollection is returning inf values for a finite 3D line collection. Code for reproduction import matpl...
X Description: Bug report Bug summary Discovered whilst investigating #17130, the get_datalim method of Line3DCollection is returning inf values for a finite 3D line collection. Code for reproduction import matpl...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/18197
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"get_datalim returns non-finite values for finite 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\nDiscovered whilst investigating https://github.com/matplotlib/matplotlib/issues/17130, the `get_datalim` method of `Line3DCollection` is returning `inf` values for a finite 3D line collection.\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 matplotlib.pyplot as plt\r\nfrom matplotlib.collections import LineCollection\r\nfrom mpl_toolkits.mplot3d import Axes3D\r\nfrom mpl_toolkits.mplot3d.art3d import Line3DCollection\r\n\r\n\r\nsegments = [[(0, 0), (1, 1)]]\r\ncollection = LineCollection(segments)\r\nfig, ax = plt.subplots()\r\nax.add_collection(collection)\r\nprint('2D:', collection.get_datalim(ax.transAxes))\r\n\r\nsegments = [[(0, 0, 0), (1, 1, 1)]]\r\ncollection = Line3DCollection(segments)\r\n\r\nfig = plt.figure()\r\nax = fig.gca(projection='3d')\r\nax.add_collection3d(collection)\r\n\r\nprint('3D:', collection.get_datalim(ax.transAxes))\r\n\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\n2D: Bbox(x0=0.0, y0=0.0, x1=1.0, y1=1.0000000000000002)\r\n3D: Bbox(x0=inf, y0=inf, x1=-inf, y1=-inf)\r\n```\r\n\r\n**Expected outcome**\r\nThe 3D case to have finite and [0, 1] bounds for x and y. Possibly it should also return the z bounds too.\r\n\r\n","author":{"url":"https://github.com/dstansby","@type":"Person","name":"dstansby"},"datePublished":"2020-08-07T09:47:21.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":5},"url":"https://github.com/18197/matplotlib/issues/18197"}
| 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:3e0a6443-fcc5-d3ff-c522-002d484cab64 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AC12:2DCEA7:1C8BE56:2651CC5:6A53697A |
| html-safe-nonce | f42f28d1e617e4439bc5ccf2a810b533df33910f7b7bfbb3d2545b4df7851d42 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQzEyOjJEQ0VBNzoxQzhCRTU2OjI2NTFDQzU6NkE1MzY5N0EiLCJ2aXNpdG9yX2lkIjoiNzg1NTM2OTQ2Mzg4NTE2Mjg3NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 4661074b91a8a9bc7f1e978f00e98fcf5fa5d375cfcedd9a31208da166a47056 |
| hovercard-subject-tag | issue:674899744 |
| 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/18197/issue_layout |
| twitter:image | https://opengraph.githubassets.com/c90e781ffb3798f86711d9f6fb35e9a4fdc81d85ab851fcb249e61e50d1b2888/matplotlib/matplotlib/issues/18197 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c90e781ffb3798f86711d9f6fb35e9a4fdc81d85ab851fcb249e61e50d1b2888/matplotlib/matplotlib/issues/18197 |
| og:image:alt | Bug report Bug summary Discovered whilst investigating #17130, the get_datalim method of Line3DCollection is returning inf values for a finite 3D line collection. Code for reproduction import matpl... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | dstansby |
| 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