ubuntu16.04
matplotlib==3.3.1
plt.subplot(row_num, row_num, index)
Passing non-integers as three-element position specification is deprecated since 3.3 and will be removed two minor releases later.
翻译:
从3.3开始,不推荐将非整数作为三元素位置规范传递,并将在两个次要版本之后删除。
看到deprecated以为是版本问题,翻译出来之后就很清晰了。
原来是row_num最后是浮点型。
import matplotlib.pyplot as plt
plt.subplot(int(row_num), int(row_num), index)