Title: Can't pickle bar plots: Failed to pickle attribute "gridline" · Issue #1719 · matplotlib/matplotlib · GitHub
Open Graph Title: Can't pickle bar plots: Failed to pickle attribute "gridline" · Issue #1719 · matplotlib/matplotlib
X Title: Can't pickle bar plots: Failed to pickle attribute "gridline" · Issue #1719 · matplotlib/matplotlib
Description: I know pickling of figures (awesome!) is still experimental, but it seems bar plots have problems. recursive_pickle() seems to give a more detailed traceback than pickle.dump(): from matplotlib.tests.test_pickle import recursive_pickle f...
Open Graph Description: I know pickling of figures (awesome!) is still experimental, but it seems bar plots have problems. recursive_pickle() seems to give a more detailed traceback than pickle.dump(): from matplotlib.tes...
X Description: I know pickling of figures (awesome!) is still experimental, but it seems bar plots have problems. recursive_pickle() seems to give a more detailed traceback than pickle.dump(): from matplotlib.tes...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/1719
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Can't pickle bar plots: Failed to pickle attribute \"gridline\"","articleBody":"I know pickling of figures (awesome!) is still experimental, but it seems bar plots have problems. `recursive_pickle()` seems to give a more detailed traceback than `pickle.dump()`:\n\n```\nfrom matplotlib.tests.test_pickle import recursive_pickle\nfrom pylab import figure, bar\nfig = figure()\nbar(left=range(10), height=range(10))\nrecursive_pickle(fig)\n```\n\ngives:\n\n```\nLine2D((0,0),(0,1))\nFailed to pickle attribute \"gridline\" in (list/tuple item #0 in (attribute \"majorTicks\" in\n(attribute \"xaxis\" in (list/tuple item #1 in (list/tuple item #1 in (list/tuple item #0 in\n(attribute \"_elements\" in (attribute \"_axstack\" in (top level object))))))))).\n Type: \u003cclass 'matplotlib.lines.Line2D'\u003e. Traceback follows:\n---------------------------------------------------------------------------\nTypeError Traceback (most recent call last)\n\u003cipython-input-9-b0c9db9f3303\u003e in \u003cmodule\u003e()\n----\u003e 1 recursive_pickle(fig)\n\n/home/mspacek/src/matplotlib/lib/matplotlib/tests/test_pickle.pyc in recursive_pickle(top_obj)\n 88 # print('trying %s' % location)\n 89 try:\n---\u003e 90 pickle.dump(obj, BytesIO(), pickle.HIGHEST_PROTOCOL)\n 91 except Exception, err:\n 92 print(obj)\n\nTypeError: expected string or Unicode object, NoneType found\n```\n\nUsing `pickle.dump()` instead like this:\n\n```\nimport pickle\nfrom io import BytesIO\nfrom pylab import figure, bar\nfig = figure()\nbar(left=range(10), height=range(10))\npickle.dump(fig, BytesIO(), pickle.HIGHEST_PROTOCOL)\n```\n\ngives a different error:\n\n```\nPicklingError: Can't pickle \u003cbuilt-in method copy_from_bbox of tuple object at 0x3406a70\u003e:\nit's not found as __main__.copy_from_bbox\n```\n\nThis is in master on Python 2.7 on Ubuntu 12.10.\n","author":{"url":"https://github.com/mspacek","@type":"Person","name":"mspacek"},"datePublished":"2013-01-30T02:42:21.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":18},"url":"https://github.com/1719/matplotlib/issues/1719"}
| 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:45e11e2d-d4bd-ab4f-ccd6-980c5e84f6e5 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 84B4:2D9C09:20B1940:2C8C774:6A541776 |
| html-safe-nonce | a94aaf052c0f795066454337d09d5436c7a1ec227240e833a6662e6bf8268f46 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NEI0OjJEOUMwOToyMEIxOTQwOjJDOEM3NzQ6NkE1NDE3NzYiLCJ2aXNpdG9yX2lkIjoiMzIxMjQxMjM0MjYyNjQyNDY5NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 7ebc4a0120e771e9da9a9aac0accf4784a731cd2c83a80abaf92a491759eb6cc |
| hovercard-subject-tag | issue:10443960 |
| 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/1719/issue_layout |
| twitter:image | https://opengraph.githubassets.com/af57b26a89b059947fa603e60e9d7f3aaa8eea7f1e64946142ff0f7e90a2f308/matplotlib/matplotlib/issues/1719 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/af57b26a89b059947fa603e60e9d7f3aaa8eea7f1e64946142ff0f7e90a2f308/matplotlib/matplotlib/issues/1719 |
| og:image:alt | I know pickling of figures (awesome!) is still experimental, but it seems bar plots have problems. recursive_pickle() seems to give a more detailed traceback than pickle.dump(): from matplotlib.tes... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | mspacek |
| 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