Skip to content

Commit

Permalink
solve issue matplotlib#28105
Browse files Browse the repository at this point in the history
  • Loading branch information
Clement Gilli committed Apr 19, 2024
1 parent acfef85 commit 1ea3239
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/matplotlib/axes/_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -5228,11 +5228,6 @@ def reduce_C_function(C: array) -> float
vmin = vmax = None
bins = None

# autoscale the norm with current accum values if it hasn't been set
if norm is not None:
if norm.vmin is None and norm.vmax is None:
norm.autoscale(accum)

if bins is not None:
if not np.iterable(bins):
minimum, maximum = min(accum), max(accum)
Expand All @@ -5248,6 +5243,11 @@ def reduce_C_function(C: array) -> float
collection._internal_update(kwargs)
collection._scale_norm(norm, vmin, vmax)

# autoscale the norm with current accum values if it hasn't been set
if norm is not None:
if collection.norm.vmin is None and collection.norm.vmax is None:
collection.norm.autoscale()

corners = ((xmin, ymin), (xmax, ymax))
self.update_datalim(corners)
self._request_autoscale_view(tight=True)
Expand Down

0 comments on commit 1ea3239

Please sign in to comment.