Closed
Description
Using matplotlib version 1.5.1 installed from pip on Linux (Fedora 22 and CentOS 7).
Trying to set certain attributes (e.g. cmap, clim) on a PatchCollection loaded from a pickle leads to an AttributeError: 'CallbackRegistry' object has no attribute 'callbacks'
:
Traceback (most recent call last):
File "mpl_pickle_pc_test.py", line 48, in <module>
pc_loaded.set_cmap(cmap)
File "<venv>/lib/python2.7/site-packages/matplotlib/cm.py", line 308, in set_cmap
self.changed()
File "<venv>/lib/python2.7/site-packages/matplotlib/cm.py", line 359, in changed
self.callbacksSM.process('changed', self)
File "<venv>/lib/python2.7/site-packages/matplotlib/cbook.py", line 560, in process
if s in self.callbacks:
AttributeError: 'CallbackRegistry' object has no attribute 'callbacks'
I've created a gist to reproduce this behavior: https://gist.github.com/jasoncpatton/c19d19b638ff10ece5d2
Oddly, if you catch the AttributeError and ignore it (set use_try = True
in the gist), the attribute is actually set on the PatchCollection. However, using any methods that take the PatchCollection as a parameter (e.g. fig.colorbar()
) will also break your code.
This behavior does not occur in version 1.4.3.
Metadata
Metadata
Assignees
Labels
No labels