plt.colormaps() returns a list of all registered colormaps. From the docs:
matplotlib.pyplot.colormaps()Matplotlib provides a number of colormaps, and others can be added using register_cmap(). This function documents the built-in colormaps, and will also return a list of all registered colormaps if called.
The list this returns includes viridis, magma, inferno and plasma for me in 1.5.0
plt.colormaps() returns a list of all registered colormaps. From the docs:
matplotlib.pyplot.colormaps()Matplotlib provides a number of colormaps, and others can be added using register_cmap(). This function documents the built-in colormaps, and will also return a list of all registered colormaps if called.
The list this returns includes viridis, magma, inferno and plasma for me in 1.5.0
Here's some code that plots all available colormaps linked to their ID's
import matplotlib as mpl
import matplotlib.pyplot as plt
def plot_colorMaps(cmap):
fig, ax = plt.subplots(figsize=(4,0.4))
col_map = plt.get_cmap(cmap)
mpl.colorbar.ColorbarBase(ax, cmap=col_map, orientation = 'horizontal')
plt.show()
for cmap_id in plt.colormaps():
print(cmap_id)
plot_colorMaps(cmap_id)
The output looks like this
Accent

Accent_r

Blues

etc...

You want to give to the colormap instance an argument varying between 0 and 1, this requires a minimum of planning, e.g.,
x = np.linspace(0,355/113, 101)
p = plt.get_cmap('plasma')
n = 23
for i in range(n):
plt.plot(x, np.sin(x-i/2/n), color=p(i/(n-1)))
One way to achieve your goal is to slice-up a colormap and then plot each line with one of the resulting colors. See the lines below that can be integrated in your code in appropriate places.
import numpy as np
import matplotlib.pyplot as plt
# 1. Choose your desired colormap
cmap = plt.get_cmap('plasma')
# 2. Segmenting the whole range (from 0 to 1) of the color map into multiple segments
slicedCM = cmap(np.linspace(0, 1, len(Subjects)))
# 3. Color the i-th line with the i-th color, i.e. slicedCM[i]
plt.plot(f, Welch, c=slicedCM[Subjects.index(Subject)])
(The first two lines can be put in the beginning and you can replace the line plotting curves in your code with the third line of code suggested above.)
Alternatively, and perhaps a neater approach, is using the below lines inside your main loop through Subjects:
cmap = plt.get_cmap('inferno')
plt.plot(f, Welch, c=cmap(Subjects.index(Subject)/len(Subjects)))
(I see in your question that you are changing Subject when you load the file again into Subject. Just use another variable name, say, data = np.loadtxt... and then f, Welch = signal.welch(data, ..... Keep the codes for plotting with different colors as suggested above and you won't have any problem.)