File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ def _color_palette(cmap, n_colors):
55
55
colors_i = np .linspace (0 , 1.0 , n_colors )
56
56
if isinstance (cmap , (list , tuple )):
57
57
# we have a list of colors
58
- cmap = ListedColormap (cmap , N = n_colors )
58
+ cmap = ListedColormap (cmap )
59
59
pal = cmap (colors_i )
60
60
elif isinstance (cmap , str ):
61
61
# we have some sort of named palette
@@ -71,7 +71,7 @@ def _color_palette(cmap, n_colors):
71
71
pal = color_palette (cmap , n_colors = n_colors )
72
72
except (ValueError , ImportError ):
73
73
# or maybe we just got a single color as a string
74
- cmap = ListedColormap ([cmap ], N = n_colors )
74
+ cmap = ListedColormap ([cmap ] * n_colors )
75
75
pal = cmap (colors_i )
76
76
else :
77
77
# cmap better be a LinearSegmentedColormap (e.g. viridis)
Original file line number Diff line number Diff line change @@ -151,6 +151,7 @@ def test_hatch_linewidth_mpl_lt_310(function):
151
151
152
152
153
153
@requires_mpl_ge_310
154
+ @pytest .mark .filterwarnings ("ignore:Passing 'N' to ListedColormap is deprecated" )
154
155
@pytest .mark .parametrize ("function" , HATCH_FUNCTIONS )
155
156
def test_hatch_linewidth_mpl_ge_310 (function ):
156
157
You can’t perform that action at this time.
0 commit comments