我正在使用 matplotlib 绘制图形,但 python 抛出错误“元组不可调用”
import matplotlib.pyplot as plt
fig, ax = plt.subplots(2, 2)
ax[0, 0].plot(range(10), 'r')
ax[1, 0].plot(range(10), 'b')
ax[0, 1].plot(range(10), 'g')
ax[1, 1].plot(range(10), 'k')
plt.show()
请您参考如下方法:
请检查您的 python 版本,因为 range() 函数在 python 2 和 python 3 中的工作方式不同
