我正在使用subplots函数将 8 列绘制成一个图形。然而,它显示“IndexError:数组的索引太多”# -*- coding: utf-8 -*-import pandas as pdfrom matplotlib import pyplot as pltfrom matplotlib import styledf = pd.read_csv('XXXX', encoding='utf-8')num = 0for dim in ['A','B','C','D','E','F','G','H']: fig, axes = plt.subplots(nrows=8, ncols=1) df[dim].plot(ax=axes[num,0]) plt.xlabel(dim) num += 1plt.show()
添加回答
举报
0/150
提交
取消