python plot画图不重复颜色

import matplotlib
import matplotlib.pyplot as plt

cmap
= matplotlib.cm.get_cmap('tab20') 然后在pyplot方法中使用 例如 patches, texts, autotexts = plt.pie(sizes, labels=[""]*len(sizes), \ autopct='%1.1f%%', shadow=False, pctdistance=0.85, \ startangle=90, textprops={'fontsize': 12, 'color': 'black'},colors=cmap.colors)

 

posted @ 2023-07-06 17:09  cup_leo  阅读(247)  评论(0编辑  收藏  举报