79304030

Date: 2024-12-23 19:33:49
Score: 0.5
Natty:
Report link

I experienced the same problem. The cause of the problem is that the color tuple is being interpreted as data, which of course is what neither you nor I want. The workaround is to convert the color tuple to a color string.

from matplotlib.colors import to_hex  # convert to hex string
if not isinstance(color, str):
    color = to_hex(color)

In your case, include the import. Then change data append line:

    data.append(to_hex(color))
Reasons:
  • Whitelisted phrase (-1): In your case
  • RegEx Blacklisted phrase (1): I want
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Eric Conrad