2017-06-06 18 views
0
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() 

enter image description hereはAttributeError:モジュールのmatplotlib.pyplot 'には属性 'xlable'

があるため、問題のバージョンのことですがありませんか?

+1

'xlabel'、' ylable' - > 'ylabel'、' lablesize' - > 'labelsize' – falsetru

+1

'label'のスペルを間違えないでください。 – jasonharper

答えて

0

あなたはこのように試すことができます:あなたが質問

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 - >xlabelylable - >ylabellablesize - >labelsizeを、label権利を綴ります。

+2

私はばかだ、ありがとう〜 – Bruin

関連する問題