使用颜色表范围,我在一个循环中绘制的代码块:单行情节
fig=plt.figure(figsize=(15,10))
ax1=fig.add_subplot(111)
ax1.plot(item['time'][:-1],item[headerss].iloc[:-1],marker='o')
ax1.legend(headerss,loc='center left', bbox_to_anchor=(1.0, 0.5))
ax1.set_xlabel('time')
ax1.set_ylabel('concentration (ppb)')
title=item['date'][0]+' '+item['list'][0]
ax1.set_title(title)
fig.savefig(title,bbox_inches='tight')
项目是一个数据帧。我有超过20 item['concentrations']
,我想要在ax1.plot
行上创建多个不同的颜色而不创建循环。
我可以使用一组现有的颜色,如Python颜色映射吗?
干杯
错误啪啪说模块“matplotlib.pyplot”有没有属性“afmhot”,如果我尝试CMAP =“普布”比如,我收到imshow()有多个值参数“CMAP”。此外,imshow弹出此消息:'DataFrame'对象是可变的,因此它们不能被散列 – Sylvain