在Matplotlib中我最喜欢做的事情之一是设置颜色循环以匹配一些颜色图,以便生成线条图,线条图具有很好的颜色渐变。喜欢这个:以前,这是使用set_color_cycle的一行代码:ax.set_color_cycle([plt.cm.spectral(i)foriinnp.linspace(0,1,num_lines)])但是,最近我看到一个警告:MatplotlibDeprecationWarning:Theset_color_cycleattributewasdeprecatedinversion1.5.Useset_prop_cycleinstead.使用set_prop_c