FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Move empty hexbin fix to make_norm_from_scale. by anntzer · Pull Request #24259 · matplotlib/matplotlib · GitHub

Repository navigation

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (2) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
4 changes: 1 addition & 3 deletions lib/matplotlib/axes/_axes.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -4993,9 +4993,7 @@ def reduce_C_function(C: array) -> float
# 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_None(accum)
norm.vmin = np.ma.masked if norm.vmin is None else norm.vmin
norm.vmax = np.ma.masked if norm.vmax is None else norm.vmax
norm.autoscale(accum)

if bins is not None:
if not np.iterable(bins):
Expand Down
4 changes: 4 additions & 0 deletions lib/matplotlib/colors.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -1718,10 +1718,14 @@ def inverse(self, value):
def autoscale(self, A):
# i.e. A[np.isfinite(...)], but also for non-array A's
in_trf_domain = np.extract(np.isfinite(self._trf.transform(A)), A)
if in_trf_domain.size == 0:
in_trf_domain = np.ma.masked
return super().autoscale(in_trf_domain)

def autoscale_None(self, A):
in_trf_domain = np.extract(np.isfinite(self._trf.transform(A)), A)
if in_trf_domain.size == 0:
in_trf_domain = np.ma.masked
return super().autoscale_None(in_trf_domain)

if base_norm_cls is Normalize:
Expand Down

Back | FazBrowse Home | New Git URL