import matplotlib.pyplot as plt
squares = [1, 4, 9, 16, 25]
plt.plot(squares, linewidth=2.0)
#设置图表标题,并给坐标加上标签
plt.title("Square Number", fontsize="24")
plt.xlabel("Value", fontsize=14)
plt.ylabel("Square of Value", fontsize=14)
#设置刻度标记的大小
plt.tick_params(axis="both", labelsiaza=14)
plt.show()
你的labelsize写成labelsiaza了,写成:plt.tick_params(axis="both", labelsize=14)就不报错了
linewidth=2, fontsize=24 试试,第9行传字符串肯定是错的。