8000 updates based on feedback from @timhoffm · matplotlib/matplotlib@ab61439 · GitHub
[go: up one dir, main page]

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(< 7BBD span class=pl-s1>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)
0