import matplotlib.pyplot as plt
%matplotlib inline
plt.plot(k_range,score_train)
plt.xlabel('x')
plt.ylabel('y')
plt.show()
这样应该就行了