I am having more then 40 items to show in my chart. I have only 10 colours that repeatedly are shown on the chart. How can I generate more colors.
plt.pie(f,la
If your pie chart is coming out with grouped chunks of the same colour when utilising the solution above, try changing the colour map from 'Set1' to any map you like from the following link: https://matplotlib.org/examples/color/colormaps_reference.html
As for randomising the colours, I suggest that you randomise the cs array in the solution above. But that doesn't really give a nice spectrum of colours.