Here is needed to plot CDF for 8 different functions in one plot. The problem that it gives just 7 different colors and the 8 one gives just first blue color again. How to make
I love to read my colors directly from a colormap with this code
def getColor(c, N, idx):
import matplotlib as mpl
cmap = mpl.cm.get_cmap(c)
norm = mpl.colors.Normalize(vmin=0.0, vmax=N - 1)
return cmap(norm(idx))
Here, c is the name of the colormap (see https://matplotlib.org/examples/color/colormaps_reference.html for a list), N is the number of colors you want in total, and idx is just an index that will yield the specific color.
Then when calling the plot function, just add the color=getColor(c, N, idx) option.