import matplotlib.pyplot as plt
squares = [1,4,9,16,25]
plt.plot(squares,linewidth=5)
plt.title('Square Number',fontsize=24)
plt.xlable('Value',fontsize=14)
plt.ylable('Square of Value',fontsize=14)
plt.tick_params(axis='both',lablesize=14)
plt.show()
是不是版本的问题?
最佳答案
你可以这样尝试:
import matplotlib.pyplot as plt
squares = [1,4,9,16,25]
plt.plot(squares,linewidth=5)
plt.title('Square Number',fontsize=24)
plt.xlabel('Value',fontsize=14)
plt.ylabel('Square of Value',fontsize=14)
plt.tick_params(axis='both',labelsize=14)
plt.show()
你的问题是而且应该改成,
xlable
-> xlabel
,
ylable
-> ylabel
,
labelsize
-> labelsize
,把label
拼对
关于python - 属性错误 : module 'matplotlib.pyplot' has no attribute 'xlable' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44381036/