leotac / joypy

Joyplots in Python with matplotlib & pandas :chart_with_upwards_trend:
MIT License
556 stars 58 forks source link

Bugfix/color list length #48

Closed yaront closed 4 years ago

yaront commented 4 years ago

In the checks list:

if isinstance(color, list): assert all(len(g) == len(color) for g in data)

returns an error if the color list [len(color)] is larger then the label size [len(g)]. But this function should work is the length of the color list is greater than then labels (still have enough colors and the index will not be out of range). That change make the test to be '<=' instead of '=='.

leotac commented 4 years ago

Looks ok, the argument "color" was already supported as a kwarg but having it explicitly doesn't hurt. The assert with a >= makes sense.