X Tutup
Skip to content

Pickle not working in interactive ipython session #3899

@jorisvandenbossche

Description

@jorisvandenbossche

When I used the %matplotlib magic in ipython (notebook) to enable interactive matplotlib plotting, pickling of figures does not work anymore.

Test code:

%matplotlib  
import matplotlib.pyplot as plt
import pickle
fig, ax = plt.subplots()
ax.plot([1,2,3,4], [1,8,4,6])
pickle.dump(ax, file('test_plot.pickle', 'w'))

gives:

PicklingError: Can't pickle <built-in method copy_from_bbox of tuple object at 0x000000000B2A2988>: it's not found as __main__.copy_from_bbox

If I remove the %matplotlib line, then it works as expected.

@pelson It was also mentioned in the SO question you answered (http://stackoverflow.com/questions/7290370/store-and-reload-matplotlib-pyplot-object), and you encouraged to open an issue report, but I did not found it.

Using matplotlib 1.4.0, Windows 7, ipython 2.3.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      X Tutup