如何管理此水平直方图的刻度?
我的代码:
d1=pd.read_csv('Gold1.Dat')
d1.dropna(subset=['WF (mV)'],how='any', inplace=True)
binwidth=5
m_n=np.floor(min(d1['WF (mV)'])/binwidth)*binwidth
m_x=np.floor(max(d1['WF (mV)'])/binwidth)*binwidth+binwidth
print(m_n)
print(m_x)
print(m_x-m_n)
binnum=int((m_x-m_n)/binwidth)
print(binnum)
a,b,c=plt.hist(d1['WF (mV)'],bins=binnum,range=(m_n,m_x),edgecolor='k',orientation='horizontal')
plt.xticks(b,rotation=45)
plt.tight_layout()
plt.savefig('vertical histogram')