Python Matplotli具有更多独特的标签颜色

时间:2020-11-02 14:17:20

标签: python matplotlib colors legend colormap

当我有多个标签时,对于K,L,M,它将开始重复相同的标签颜色。我想拥有简单清晰的独特颜色。我可以以某种方式在例如plt.legend()参数中设置此调色板吗?

import numpy as np
df3 = pd.DataFrame(np.random.randn(100, 13), columns=['A','B','C','D', 'E', 'F', 'G', 'H', 'I', 'J', 
'K', 'L', 'M']).cumsum()

df3.plot(style='x-')
plt.legend()

创建:

enter image description here

0 个答案:

没有答案