def test_mpl_colormap_diverging_reverse(self): colors = mplcmap_to_palette('RdBu_r', 3) self.assertEqual(colors, ['#67001f', '#f7f6f6', '#053061'][::-1])
def test_mpl_colormap_perceptually_uniform_reverse(self): colors = mplcmap_to_palette('viridis_r', 4) self.assertEqual(colors, ['#440154', '#30678d', '#35b778', '#fde724'][::-1])
def test_mpl_colormap_diverging(self): colors = mplcmap_to_palette('RdBu', 3) self.assertEqual(colors, ['#67001f', '#f6f6f6', '#053061'])
def test_mpl_colormap_sequential_reverse(self): colors = mplcmap_to_palette('YlGn_r', 3) self.assertEqual(colors, ['#ffffe5', '#78c679', '#004529'][::-1])
def test_mpl_colormap_sequential(self): colors = mplcmap_to_palette('YlGn', 3) self.assertEqual(colors, ['#ffffe5', '#77c578', '#004529'])
def test_mpl_colormap_categorical_reverse(self): colors = mplcmap_to_palette('Category20_r', 3) self.assertEqual(colors, ['#1f77b4', '#8c564b', '#9edae5'][::-1])
def test_mpl_colormap_categorical(self): colors = mplcmap_to_palette('Category20', 3) self.assertEqual(colors, ['#1f77b4', '#c5b0d5', '#9edae5'])