2017-03-02 115 views

回答

2

问题是您正在设置plthist(),这不是你想要的。这是常见的导入matplotlib为plt,假设这就是在这里意:

import matplotlib.pyplot as plt 

data = [1, 2, 3, 4] 

p = plt.hist(data) 
plt.xticks(rotation='vertical') 

plt.show() 

enter image description here