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):
5555 colors_i = np .linspace (0 , 1.0 , n_colors )
5656 if isinstance (cmap , (list , tuple )):
5757 # we have a list of colors
58- cmap = ListedColormap (cmap , N = n_colors )
58+ cmap = ListedColormap (cmap )
5959 pal = cmap (colors_i )
6060 elif isinstance (cmap , str ):
6161 # we have some sort of named palette
@@ -71,7 +71,7 @@ def _color_palette(cmap, n_colors):
7171 pal = color_palette (cmap , n_colors = n_colors )
7272 except (ValueError , ImportError ):
7373 # or maybe we just got a single color as a string
74- cmap = ListedColormap ([cmap ], N = n_colors )
74+ cmap = ListedColormap ([cmap ] * n_colors )
7575 pal = cmap (colors_i )
7676 else :
7777 # 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):
151151
152152
153153@requires_mpl_ge_310
154+ @pytest .mark .filterwarnings ("ignore:Passing 'N' to ListedColormap is deprecated" )
154155@pytest .mark .parametrize ("function" , HATCH_FUNCTIONS )
155156def test_hatch_linewidth_mpl_ge_310 (function ):
156157
You can’t perform that action at this time.
0 commit comments