Title: Bug in AxesStack.add · Issue #7194 · matplotlib/matplotlib · GitHub
Open Graph Title: Bug in AxesStack.add · Issue #7194 · matplotlib/matplotlib
X Title: Bug in AxesStack.add · Issue #7194 · matplotlib/matplotlib
Description: I think I've found a bug where the format of data actually stored in Stack is different from that expected in Stack.remove. It seems that the line below needs to be: Stack.remove(self, self._entry_from_axes(a_existing)) I don't have a mi...
Open Graph Description: I think I've found a bug where the format of data actually stored in Stack is different from that expected in Stack.remove. It seems that the line below needs to be: Stack.remove(self, self._entry_...
X Description: I think I've found a bug where the format of data actually stored in Stack is different from that expected in Stack.remove. It seems that the line below needs to be: Stack.remove(self, self._en...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/7194
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Bug in AxesStack.add","articleBody":"I think I've found a bug where the format of data actually stored in Stack is different from that expected in Stack.remove. It seems that the line below needs to be:\nStack.remove(self, self._entry_from_axes(a_existing))\n\nI don't have a minimal repro case (probably something to do with multi-threading in a tensorflow py_func), but I've been seeing exceptions in the .remove method. Adding some more useful exception messaging shows me a missing self._ind 0th tuple element.\n\n```\n\nAxesStack.add(((1, 1, 1), ()),..): Axes(0.125,0.1;0.775x0.8) vs Axes(0.125,0.1;0.775x0.8)\n ^key ^ a ^a_existing\n\nmatplotlib/cbook.py\", line 1410, in remove\n raise ValueError('Unknown element o: %s vs %s' % (o, self._elements))\n\nUnknown element o: (((1, 1, 1), ()), \u003cmatplotlib.axes._subplots.AxesSubplot object at 0\nx7fd416508550\u003e) vs [(((1, 1, 1), ()), (1, \u003cmatplotlib.axes._subplots.AxesSubplot object at 0x7fd416\n508550\u003e))]\n\n def add(self, key, a):\n \"\"\"\n Add Axes *a*, with key *key*, to the stack, and return the stack.\n If *a* is already on the stack, don't add it again, but\n return *None*.\n \"\"\"\n # All the error checking may be unnecessary; but this method\n # is called so seldom that the overhead is negligible.\n if not isinstance(a, Axes):\n raise ValueError(\"second argument, %s, is not an Axes\" % a)\n try:\n hash(key)\n except TypeError:\n raise ValueError(\"first argument, %s, is not a valid key\" % key)\n\n a_existing = self.get(key)\n if a_existing is not None:\nHERE--\u003e Stack.remove(self, (key, a_existing))\n warnings.warn(\n \"key %s already existed; Axes is being replaced\" % key)\n # I don't think the above should ever happen.\n\n if a in self:\n return None\n self._ind += 1\n return Stack.push(self, (key, (self._ind, a)))\n\n\n```\n\nTo help us understand and resolve your issue please check that you have provided\nthe information below.\n- [ ] Matplotlib version, Python version and Platform (Windows, OSX, Linux ...)\n- [ ] How did you install Matplotlib and Python (pip, anaconda, from source ...)\n- [ ] If possible please supply a [Short, Self Contained, Correct, Example](http://sscce.org/)\n that demonstrates the issue i.e a small piece of code which reproduces the issue\n and can be run with out any other (or as few as possible) external dependencies.\n- [ ] If this is an image generation bug attach a screenshot demonstrating the issue.\n- [ ] If this is a regression (Used to work in an earlier version of Matplotlib), please \n note where it used to work.\n","author":{"url":"https://github.com/brianwa84","@type":"Person","name":"brianwa84"},"datePublished":"2016-09-28T17:04:32.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":8},"url":"https://github.com/7194/matplotlib/issues/7194"}
| 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:37fb5fab-fc14-04ba-757f-d5aa273f1ef9 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9866:111866:293A061:36C146D:6A521667 |
| html-safe-nonce | c657c218456cd3722cb1e9d3801f3f73c80870b88e9a5551d179b0a200084659 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5ODY2OjExMTg2NjoyOTNBMDYxOjM2QzE0NkQ6NkE1MjE2NjciLCJ2aXNpdG9yX2lkIjoiNzM3NDIzNDQ0NTU2NDQ4MzE3NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 3a7c5799d3ed3cdd58c50c4c53c6db8446eec0c6ca0b449ea7277d6f267671ce |
| hovercard-subject-tag | issue:179830257 |
| 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/7194/issue_layout |
| twitter:image | https://opengraph.githubassets.com/25ad6814c8447e875ed946ea0185c83424b9f54eb25b7c677289edc05e51f09e/matplotlib/matplotlib/issues/7194 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/25ad6814c8447e875ed946ea0185c83424b9f54eb25b7c677289edc05e51f09e/matplotlib/matplotlib/issues/7194 |
| og:image:alt | I think I've found a bug where the format of data actually stored in Stack is different from that expected in Stack.remove. It seems that the line below needs to be: Stack.remove(self, self._entry_... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | brianwa84 |
| 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 | 7aed05249554b889eb33d002851a973eebcc7e91 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width