Skip to content

Commit ab61439

Browse files
committed
updates based on feedback from @timhoffm
1 parent 63feb6b commit ab61439

File tree

5 files changed

+208
-69
lines changed

5 files changed

+208
-69
lines changed

doc/api/colors_api.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ Color norms
3232
PowerNorm
3333
SymLogNorm
3434
TwoSlopeNorm
35+
MultiNorm
3536

3637
Univariate Colormaps
3738
--------------------

lib/matplotlib/colorizer.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,13 @@ def to_rgba(self, x, alpha=None, bytes=False, norm=True):
154154
# Otherwise run norm -> colormap pipeline
155155
x = ma.asarray(x)
156156
if norm:
157-
x = self.norm(x)
157+
if isinstance(self.norm, colors.MultiNorm):
158+
# using structured_output=False gives one less
159+
# memcopy operation
160+
x = self.norm(x, structured_output=False)
161+
else:
162+
x = self.norm(x)
163+
158164
rgba = self.cmap(x, alpha=alpha, bytes=bytes)
159165
return rgba
160166

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