报错代码如下:
import matplotlib.pyplot as plt
fig,ax = plt.subplots(2,2,figsize=(10,10))
ax[0].set_title('Pixlated xxxx')
是ax[0].set_title('Pixlated xxxx')报错,解决方法如下:
把上面这一句修改为:
ax[0,0].set_title('Pixlated xxxx')
总结如下:
可能是matplotlib库的版本问题导致以前的代码现在不能用了,要改成上面的样子就可以了。