首页 > 解决方案 > 无法在 matplotlib 中找到彩虹方法

问题描述

我使用matplotlib的是 2.2.3,下面是我的代码

import matplotlib.pyplot as plt
"""Plot out the different clusters"""

# Choose a different colour for each cluster
colour = plt.cm.rainbow(np.linspace(0, 1, len(centroids)))

它会抛出找不到rainbow参考

标签: pythonmatplotlib

解决方案


推荐阅读