使用顏色表範圍,我在一個循環中繪製的代碼塊:單行情節
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