python实现给scatter设置颜⾊渐变条colorbar的⽅法python设置scatter颜⾊渐变的⽅法 参考代码如下:import matplotlib.pyplot as plt cm = plt.cm.get_cmap('RdYlBu')xy = range(20)z = xy sc = plt.scatter(xy, xy, c=z, vmin=0, vmax=20, s=35, cmap=cm)plt.colorbar(sc)plt.show() 其中...
python设置scatter颜色渐变的方法 参考代码如下:import matplotlib.pyplot as plt cm = plt.cm.get_cmap('RdYlBu') xy = range(20) z = xy sc = plt.scatter(xy, xy, c=z, vmin=0, vmax=20, s=35, cmap=cm) plt.colorbar(sc) plt.show()其中get_cmap中取值可为: Possible values are: Accent...