'Unable to print actual colors using sns.color_palette() (Matplotlib 3.5.2)

I recently upgraded to Matplotlib 3.5.2. I used to be able to print the colors of a palette using, for example:

sns.color_palette("hls", 8)

As described in the documentation, the above line should print the 8 specified colors.

Instead, I am getting the color codes:

 [(0.86, 0.3712, 0.33999999999999997),
 (0.86, 0.7612000000000001, 0.33999999999999997),
 (0.5688000000000001, 0.86, 0.33999999999999997),
 (0.33999999999999997, 0.86, 0.5012000000000001),
 (0.33999999999999997, 0.8287999999999999, 0.86),
 (0.33999999999999997, 0.43879999999999986, 0.86),
 (0.6311999999999998, 0.33999999999999997, 0.86),
 (0.86, 0.33999999999999997, 0.6987999999999996)]

I am using Matplotlib 3.5.2, Jupyter Notebook 6.0.3, Python 3.8.3. How can I get the colors to be printed? Many thanks and apologies in advance if I overlooked something obvious.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source