Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 613157d

Browse files
committed
Rename reduce -> resample
1 parent e006b28 commit 613157d

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

lib/matplotlib/cm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ def get_cmap(name=None, lut=None):
159159
if lut is None:
160160
return cmap_d[name]
161161
else:
162-
return cmap_d[name].reduce(lut)
162+
return cmap_d[name].resample(lut)
163163
else:
164164
raise ValueError(
165165
"Colormap %s is not recognized. Possible values are: %s"

lib/matplotlib/colors.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -659,9 +659,9 @@ def is_gray(self):
659659
return (np.alltrue(self._lut[:, 0] == self._lut[:, 1]) and
660660
np.alltrue(self._lut[:, 0] == self._lut[:, 2]))
661661

662-
def reduce(self, lutsize):
662+
def resample(self, lutsize):
663663
"""
664-
Return a new color map with the *lutsize* entries.
664+
Return a new color map with *lutsize* entries.
665665
"""
666666
raise NotImplementedError()
667667

@@ -778,9 +778,9 @@ def from_list(name, colors, N=256, gamma=1.0):
778778

779779
return LinearSegmentedColormap(name, cdict, N, gamma)
780780

781-
def reduce(self, lutsize):
781+
def resample(self, lutsize):
782782
"""
783-
Return a new color map with the *lutsize* entries.
783+
Return a new color map with *lutsize* entries.
784784
"""
785785
return LinearSegmentedColormap(self.name, self._segmentdata, lutsize)
786786

@@ -848,9 +848,9 @@ def _init(self):
848848
self._isinit = True
849849
self._set_extremes()
850850

851-
def reduce(self, lutsize):
851+
def resample(self, lutsize):
852852
"""
853-
Return a new color map with the *lutsize* entries.
853+
Return a new color map with *lutsize* entries.
854854
"""
855855
return ListedColormap(self.name, self.colors, lutsize)
856856

0 commit comments

Comments
 (0)