matplotlib-chord-diagram
matplotlib-chord-diagram copied to clipboard
Updated the code to include support for matplotlib colormaps
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.
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).
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.