画子图时出错ValueError: Single argument to subplot must be a three-digit integer, not ‘xxx‘

我在作子图时subplot用的是占位符

 plt.subplot('22%d'%(i+1))

出现这个错误ValueError: Single argument to subplot must be a three-digit integer, not '221'

 然后我改成这样:

plt.subplot(2,2,(i+1))

 输出就成功了

这个错误的帖子是有的,说是单个轴不能大于9,但我用的是占位符时出现的错误与直接连用数字稍有不同,所以我也写了一个。