由于之前绘制squares列表图表时,图上点位与坐标轴刻度对应不上,特此修复
import matplotlib.pyplot as plt input_values = [1,2,3,4,5] # 新加变量input_values,为将与squares组成横纵坐标点 squares = [1,4,9,16,25] fig,ax = plt.subplots() ax.plot(input_values,squares) # 设置横纵坐标点 plt.show()