Title: DeprecationWarning from calc_label_rot_and_inline in contour.py - array index is a float · Issue #3137 · matplotlib/matplotlib · GitHub
Open Graph Title: DeprecationWarning from calc_label_rot_and_inline in contour.py - array index is a float · Issue #3137 · matplotlib/matplotlib
X Title: DeprecationWarning from calc_label_rot_and_inline in contour.py - array index is a float · Issue #3137 · matplotlib/matplotlib
Description: When I use the function clabel, I receive the warning: /usr/lib/pymodules/python2.7/matplotlib/contour.py:486: DeprecationWarning: using a non-integer number instead of an integer will result in an error in the future nlc.append(np.r_[xy...
Open Graph Description: When I use the function clabel, I receive the warning: /usr/lib/pymodules/python2.7/matplotlib/contour.py:486: DeprecationWarning: using a non-integer number instead of an integer will result in an...
X Description: When I use the function clabel, I receive the warning: /usr/lib/pymodules/python2.7/matplotlib/contour.py:486: DeprecationWarning: using a non-integer number instead of an integer will result in an...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/3137
X: @github
Domain: github.com
IPv4 address: 140.82.113.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"DeprecationWarning from calc_label_rot_and_inline in contour.py - array index is a float","articleBody":"When I use the function `clabel`, I receive the warning:\n\n```\n/usr/lib/pymodules/python2.7/matplotlib/contour.py:486: DeprecationWarning: using a\nnon-integer number instead of an integer will result in an error in the future\nnlc.append(np.r_[xy2, lc[I[1]:]])\n```\n\nThe problem is that the array index `I` in `lc[I[1]:]]` is a float not an integer. The current code is\n\n```\n # Make integer\n I = [np.floor(I[0]), np.ceil(I[1])]\n```\n\nUnfortunately, `floor` and `ceil` return floats rather than integers. I suggest converting `I` to integers, if possible (need to take care, make sure we don't do `int(nan)`)\n\n```\n # Make integer\n I = [np.floor(I[0]), np.ceil(I[1])]\n I = [ int(i) if not np.isnan(i) else i for i in I ]\n```\n\nor something similar - is there a way to make `floor` and `ceil` return integers? If not, maybe this will do.\n","author":{"url":"https://github.com/andrewfowlie","@type":"Person","name":"andrewfowlie"},"datePublished":"2014-06-15T10:59:33Z","url":"https://github.com/matplotlib/matplotlib/issues/3137"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| 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:a4510975-b7d3-77b4-5be9-9f42d88da4eb |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D5D2:DFA9C:4CB6E2:680D86:6B067C82 |
| html-safe-nonce | 927596ab1a0f2c54fb05eb48f1c75289024d1cfb845466b9d4d369c4fd506ab1 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENUQyOkRGQTlDOjRDQjZFMjo2ODBEODY6NkIwNjdDODIiLCJ2aXNpdG9yX2lkIjoiNDQ0MDE3MDAyNzQyNTM2NTEyMyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | cdc28fdaa5a489c08e780935439402cb0d6b32ffbe39d7257cdc6443e8f3613c |
| hovercard-subject-tag | issue:35747016 |
| 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/3137/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e069c43ba9eb878a0a10c01c221c087b023db7e8088200de9731c5e992c5234e/matplotlib/matplotlib/issues/3137 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e069c43ba9eb878a0a10c01c221c087b023db7e8088200de9731c5e992c5234e/matplotlib/matplotlib/issues/3137 |
| og:image:alt | When I use the function clabel, I receive the warning: /usr/lib/pymodules/python2.7/matplotlib/contour.py:486: DeprecationWarning: using a non-integer number instead of an integer will result in an... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | andrewfowlie |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4462ff7ebfd3d551f202659f2423dae617b6849d23b1df6465dc504ef497d14a |
| 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 | 6d3909414814ff86ce7da4c51a0f4918a13fb41b |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width