I am using tab20 colormap of matplotlib library and generated ten distinct colors in the following way:
cm = plt.get_cmap('tab20')
cy = cycler('color', [cm(1.*i/10)
for i in range(10)])
If I type cy[0] I do not get the first color. I get the error
"Can only use slices with Cycler.__getitem__".
I need to extract the colors based on the indices. Is there a way to do that?