Skip to content

Commit ce385fe

Browse files
committed
Avoid checking limits when updating both min and max for contours
closes matplotlib#26531
1 parent e5fd2d5 commit ce385fe

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

lib/matplotlib/contour.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -887,11 +887,12 @@ def __init__(self, ax, *args,
887887
self.set_cmap(cmap)
888888
if norm is not None:
889889
self.set_norm(norm)
890-
if vmin is not None:
891-
self.norm.vmin = vmin
892-
if vmax is not None:
893-
self.norm.vmax = vmax
894-
self._process_colors()
890+
with self.norm.callbacks.blocked(signal="changed"):
891+
if vmin is not None:
892+
self.norm.vmin = vmin
893+
if vmax is not None:
894+
self.norm.vmax = vmax
895+
self._process_colors()
895896

896897
if self._paths is None:
897898
self._paths = self._make_paths_from_contour_generator()

0 commit comments

Comments
 (0)