matplotlib-chord-diagram icon indicating copy to clipboard operation
matplotlib-chord-diagram copied to clipboard

Updated the code to include support for matplotlib colormaps

Open pakitochus opened this issue 7 years ago • 2 comments

By default it uses colormap='rainbow' to generate colors, so that there is no error if len(x)>10. A list of color can still be specified, and if len(x) not > 10 it will apply. hex2rgb has changed to numpy array to comply with matplotlib colormaps specification.

pakitochus avatar Jan 24 '18 10:01 pakitochus

The requested changes have been added. I slightly changed the code, prioritizing category10 and asserting afterwards if len(x)<=len(colors) to raise an error if there were more categories than colors. Added option for colormap as keyword in the same variable (colors).

pakitochus avatar Feb 02 '18 12:02 pakitochus

Thanks. The changes in matplotlib-chord.py is good. Sorry for the late reply.

I don't have experience on PR, so I am not sure whether it will interfere your PR if I directly change README.md. So please also update README.md and example.png accordingly.

fengwangPhysics avatar Feb 05 '18 03:02 fengwangPhysics