10000 removed callbacks from ColorizingArtist · matplotlib/matplotlib@4a87c8b · GitHub
[go: up one dir, main page]

Skip to content

Commit 4a87c8b

Browse files
committed
removed callbacks from ColorizingArtist
1 parent b4af71e commit 4a87c8b

File tree

4 files changed

+11
-10
lines changed

4 files changed

+11
-10
lines changed

lib/matplotlib/artist.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1421,8 +1421,8 @@ def __init__(self, norm=None, cmap=None):
14211421
else:
14221422
self._colorizer = cm.Colorizer(cmap, norm)
14231423

1424-
self._id_colorizer = self.colorizer.callbacks.connect('changed', self.changed)
1425-
self.callbacks = cbook.CallbackRegistry(signals=["changed"])
1424+
# self._id_colorizer = self.colorizer.callbacks.connect('changed', self.changed)
1425+
# self.callbacks = cbook.CallbackRegistry(signals=["changed"])
14261426

14271427
def set_array(self, A):
14281428
"""
@@ -1478,11 +1478,11 @@ def _set_colorizer(self, colorizer):
14781478
raise ValueError('The new Colorizer object must have the same'
14791479
' number of variates as the existing data.')
14801480
else:
1481-
self.colorizer.callbacks.disconnect(self._id_colorizer)
1481+
# self.colorizer.callbacks.disconnect(self._id_colorizer)
14821482
self._colorizer = colorizer
1483-
self._id_colorizer = colorizer.callbacks.connect('changed',
1484-
self.changed)
1485-
self.changed()
1483+
# self._id_colorizer = colorizer.callbacks.connect('changed',
1484+
# self.changed)
1485+
# self.changed()
14861486
else:
14871487
raise ValueError('Only a Colorizer object can be set to colorizer.')
14881488

@@ -1496,14 +1496,15 @@ def _get_colorizer(self):
14961496
"""
14971497
return self._colorizer
14981498

1499+
'''
14991500
def changed(self):
15001501
"""
15011502
Call this whenever the mappable is changed to notify all the
15021503
callbackSM listeners to the 'changed' signal.
15031504
"""
15041505
self.callbacks.process('changed')
15051506
self.stale = True
1506-
1507+
'''
15071508
def format_cursor_data(self, data):
15081509
"""
15091510
Return a string representation of *data*.

lib/matplotlib/axes/_axes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5380,7 +5380,7 @@ def on_changed():
53805380
collection.vbar.set_cmap(collection.get_cmap())
53815381
collection.hbar.set_cmap(collection.get_cmap())
53825382

5383-
collection.callbacks.connect('changed', on_changed)
5383+
collection.colorizer.callbacks.connect('changed', on_changed)
53845384

53855385
return collection
53865386

lib/matplotlib/contour.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1118,7 +1118,7 @@ def changed(self):
11181118
for label, cv, alpha in zip(self.labelTexts, self.labelCValues, alphas):
11191119
label.set_alpha(alpha)
11201120
label.set_color(self.colorizer.to_rgba(cv))
1121-
super().changed()
1121+
# super().colorizer.changed()
11221122

11231123
def _autolev(self, N):
11241124
"""

lib/mpl_toolkits/mplot3d/tests/test_axes3d.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2103,7 +2103,7 @@ def test_scalarmap_update(fig_test, fig_ref):
21032103
# force a draw
21042104
fig_test.canvas.draw()
21052105
# mark it as "stale"
2106-
sc_test.changed()
2106+
sc_test.colorizer.changed()
21072107

21082108
# ref
21092109
ax_ref = fig_ref.add_subplot(111, projection='3d')

0 commit comments

Comments
 (0)
0