0
所以我有这个数据集显示了数十亿国家的GDP(所以1万亿gdp = 1000)。Seaborn:设置distplot bin范围?
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
%matplotlib inline
df = pd.read_csv('2014_World_GDP')
df.sort('GDP (BILLIONS)',ascending=False, inplace=True)
sorted = df['GDP (BILLIONS)']
fig, ax = plt.subplots(figsize=(12, 8))
sns.distplot(sorted,bins=8,kde=False,ax=ax)
上面的代码给我下图:
我想要做的不管是谁设置的垃圾箱范围,使他们看起来更像[250,500,750,1000,2000,5000,10000,20000什么]。
有没有办法做到这一点seaborn?
每API文档,使用'hist_kws'参数:http://seaborn.pydata.org/generated/seaborn.distplot.html#seaborn.distplot –