Hi, can someone help me why despite of setting cmap:
cmap = plt.colormaps.get_cmap('Set3')
and following snippet of the code:
for index, wn in enumerate(energylist):
color = cmap(index / len(energylist))
#single gauss function line plot
if show_single_gauss:
ax.plot(plt_range_x,gauss(intenslist[index], plt_range_x, wn, w),color=color,alpha=0.25)
#single gauss function filled plot
legend_labels = [f'S{index+1}' for index in range(10)]
if show_single_gauss_area:
ax.fill_between(plt_range_x,gauss(intenslist[index], plt_range_x, wn, w),color=color,alpha=0.25)
handles = [plt.Rectangle((0,0),1,1, color=color, alpha=0.25) for index in range(len(energylist))]
ax.legend(handles, legend_labels, title='Single Gaussians', loc='center left', bbox_to_anchor=(1, 0.5))
plt.subplots_adjust(right=0.85) # Adjust plot layout to make room for legend
# sum of gauss functions
gauss_sum.append(gauss(intenslist[index], plt_range_x, wn, w))
the legend shows wrong?