Skip to content

Commit cc76eb6

Browse files
authored
Merge pull request #24324 from meeseeksmachine/auto-backport-of-pr-24259-on-v3.6.x
Backport PR #24259 on branch v3.6.x (Move empty hexbin fix to make_norm_from_scale.)
2 parents c402f78 + 0af7ef5 commit cc76eb6

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4959,9 +4959,7 @@ def reduce_C_function(C: array) -> float
49594959
# autoscale the norm with current accum values if it hasn't been set
49604960
if norm is not None:
49614961
if norm.vmin is None and norm.vmax is None:
4962-
norm.autoscale_None(accum)
4963-
norm.vmin = np.ma.masked if norm.vmin is None else norm.vmin
4964-
norm.vmax = np.ma.masked if norm.vmax is None else norm.vmax
4962+
norm.autoscale(accum)
49654963

49664964
if bins is not None:
49674965
if not np.iterable(bins):

lib/matplotlib/colors.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1718,10 +1718,14 @@ def inverse(self, value):
17181718
def autoscale(self, A):
17191719
# i.e. A[np.isfinite(...)], but also for non-array A's
17201720
in_trf_domain = np.extract(np.isfinite(self._trf.transform(A)), A)
1721+
if in_trf_domain.size == 0:
1722+
in_trf_domain = np.ma.masked
17211723
return super().autoscale(in_trf_domain)
17221724

17231725
def autoscale_None(self, A):
17241726
in_trf_domain = np.extract(np.isfinite(self._trf.transform(A)), A)
1727+
if in_trf_domain.size == 0:
1728+
in_trf_domain = np.ma.masked
17251729
return super().autoscale_None(in_trf_domain)
17261730

17271731
if base_norm_cls is Normalize:

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy