Python 中更精确的直方图
More precise histogram in Python
import pandas as pd
import matplotlib.pyplot as plt
plt.hist(rm['people'], range = [0,100000], color = 'b', orientation='horizontal')
plt.title('Histogram')
plt.xlabel('people')
plt.ylabel('Frequency')
plt.show()
大家好
我得到了这个直方图代码,它给了我这个图表。我希望它与这张图表相同
任何帮助
谢谢
指定 bins
绘制更多条形:
plt.hist(rm['people'], range = [0,100000], bins=500, color='b', orientation='horizontal')
import pandas as pd
import matplotlib.pyplot as plt
plt.hist(rm['people'], range = [0,100000], color = 'b', orientation='horizontal')
plt.title('Histogram')
plt.xlabel('people')
plt.ylabel('Frequency')
plt.show()
大家好
我得到了这个直方图代码,它给了我这个图表。我希望它与这张图表相同
任何帮助 谢谢
指定 bins
绘制更多条形:
plt.hist(rm['people'], range = [0,100000], bins=500, color='b', orientation='horizontal')