@@ -782,10 +782,6 @@ def __init__(self, *args, cyclic=False, alpha=None, **kwargs):
782
782
if alpha is not None :
783
783
self .set_alpha (alpha )
784
784
785
- def _resample (self , N ):
786
- """Return a resampled copy of the colormap with the same name."""
787
- return self .updated (name = self .name , N = N )
788
-
789
785
def concatenate (self , * args , ratios = 1 , name = None , N = None , ** kwargs ):
790
786
"""
791
787
Return the concatenation of this colormap with the
@@ -1610,10 +1606,6 @@ def _init(self):
1610
1606
self ._lut [i , :3 ] = to_rgb (self ._lut [i , :3 ], self ._space )
1611
1607
self ._lut [:, :3 ] = _clip_colors (self ._lut [:, :3 ], self ._clip )
1612
1608
1613
- def _resample (self , N ):
1614
- """Return a resampled copy of the colormap with the same name."""
1615
- return self .updated (name = self .name , N = N )
1616
-
1617
1609
@staticmethod
1618
1610
def from_color (name , color , fade = None , space = 'hsl' , ** kwargs ):
1619
1611
"""
@@ -2251,13 +2243,10 @@ def Colormap(
2251
2243
cmaps .append (cmap )
2252
2244
2253
2245
# Merge the result of this arbitrary user input
2254
- N = kwargs .pop ('N' , None )
2255
2246
if len (cmaps ) > 1 : # more than one map?
2256
- cmap = cmaps [0 ].concatenate (* cmaps [1 :], N = N , ** kwargs )
2247
+ cmap = cmaps [0 ].concatenate (* cmaps [1 :], ** kwargs )
2257
2248
elif kwargs : # modify any props?
2258
2249
cmap = cmaps [0 ].updated (** kwargs )
2259
- elif N :
2260
- cmap = cmap ._resample (N )
2261
2250
2262
2251
# Cut the center and roate the colormap
2263
2252
if cut is not None :
@@ -3243,9 +3232,9 @@ def _draw_bars(
3243
3232
ax = axs [iax ]
3244
3233
cmap = mcm .cmap_d [name ]
3245
3234
if N is not None :
3246
- cmap = cmap ._resample ( N )
3235
+ cmap = cmap .updated ( N = N )
3247
3236
ax .colorbar ( # TODO: support this in public API
3248
- mcm . cmap_d [ name ] , loc = '_fill' ,
3237
+ cmap , loc = '_fill' ,
3249
3238
orientation = 'horizontal' , locator = 'null' , linewidth = 0
3250
3239
)
3251
3240
ax .text (
@@ -3577,7 +3566,7 @@ def _color_filter(i, hcl): # noqa: E306
3577
3566
return figs
3578
3567
3579
3568
3580
- def show_cmaps (* args , N = None , ** kwargs ):
3569
+ def show_cmaps (* args , ** kwargs ):
3581
3570
"""
3582
3571
Generate a table of the registered colormaps or the input colormaps
3583
3572
categorized by source. Adapted from `this example \
@@ -3607,9 +3596,8 @@ def show_cmaps(*args, N=None, **kwargs):
3607
3596
The figure.
3608
3597
"""
3609
3598
# Have colormaps separated into categories
3610
- N = _notNone (N , rcParams ['image.lut' ])
3611
3599
if args :
3612
- names = [Colormap (cmap , N = N ).name for cmap in args ]
3600
+ names = [Colormap (cmap ).name for cmap in args ]
3613
3601
else :
3614
3602
names = [
3615
3603
name for name in mcm .cmap_d .keys () if
0 commit comments