我正在使用subplots函数将 8 列绘制成一个图形。然而,它显示
“IndexError:数组的索引太多”
# -*- coding: utf-8 -*-
import pandas as pd
from matplotlib import pyplot as plt
from matplotlib import style
df = pd.read_csv('XXXX', encoding='utf-8')
num = 0
for 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 += 1
plt.show()
相关分类