unable to pickle.load an AxesSubplot object · Issue #3986 · matplotlib/matplotlib · GitHub
Skip to content

unable to pickle.load an AxesSubplot object #3986

Description

@sektoid0

Python 2.7.9 :: Anaconda 2.1.0 (64-bit)
Matplotlib 1.4.0

On an example code from http://stackoverflow.com/questions/7290370/store-and-reload-matplotlib-pyplot-object getting a following exception on pickle load.

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-2-37de7fcd9451> in <module>()
      2 import pickle
      3 
----> 4 ax = pickle.load(file('myplot.pickle', 'rb'))
      5 plt.show()    

/home/anaconda/envs/py27/lib/python2.7/pickle.pyc in load(file)
   1376 
   1377 def load(file):
-> 1378     return Unpickler(file).load()
   1379 
   1380 def loads(str):    

/home/anaconda/envs/py27/lib/python2.7/pickle.pyc in load(self)
    856             while 1:
    857                 key = read(1)
--> 858                 dispatch[key](self)
    859         except _Stop, stopinst:
    860             return stopinst.value    

/home/anaconda/envs/py27/lib/python2.7/pickle.pyc in load_build(self)
   1215         setstate = getattr(inst, "__setstate__", None)
   1216         if setstate:
-> 1217             setstate(state)
   1218             return
   1219         slotstate = None    

/home/anaconda/envs/py27/lib/python2.7/site-packages/matplotlib/figure.pyc in __setstate__(self, state)
   1343             allnums = plt.get_fignums()
   1344             num = max(allnums) + 1 if allnums else 1
-> 1345             mgr = plt._backend_mod.new_figure_manager_given_figure(num, self)
   1346 
   1347             # XXX The following is a copy and paste from pyplot. Consider    

AttributeError: 'module' object has no attribute 'new_figure_manager_given_figure'

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions