Set a colormap under a graph
问题 I know this is well documented, but I'm struggling to implement this in my code. I would like to shade the area under my graph with a colormap. Is it possible to have a colour, i.e. red from any points over 30, and a gradient up until that point? I am using the method fill_between, but I'm happy to change this if there is a better way to do it. def plot(sd_values): plt.figure() sd_values=np.array(sd_values) x=np.arange(len(sd_values)) plt.plot(x,sd_values, linewidth=1) plt.fill_between(x,sd