2016-03-22 52 views
3

群的情节,我知道这个问题是不是很翔实..但我不知道他的类型情节的名字,我不能提供更多的信息.​​.如何创建与matplotlib

[编辑]我改变了标题,而现在是更多的信息.​​..

enter image description here

+0

你检查[中matplotlib画廊(http://matplotlib.org/gallery。 HTML)? – MSeifert

+2

您也可以查看[''seaborn.swarmplot'](https://stanford.edu/~mwaskom/software/seaborn/generated/seaborn.swarmplot.html#seaborn.swarmplot)或['seaborn.stripplot']( https://stanford.edu/~mwaskom/software/seaborn/generated/seaborn.stripplot.html#seaborn.stripplot) – tom

+0

我同意@汤姆的最后一篇文章。这看起来像带错误条的群绘图。 – kazemakase

回答

8

你可以做seaborn.swarmplot类似的东西。我也使用seaborn.boxplot(与胡须和瓶盖关闭)绘制的均值和范围:

import matplotlib.pyplot as plt 
import seaborn as sns 
sns.set_style("whitegrid") 
tips = sns.load_dataset("tips") 
ax = sns.swarmplot(x="day", y="total_bill", data=tips) 
ax = sns.boxplot(x="day", y="total_bill", data=tips, 
     showcaps=False,boxprops={'facecolor':'None'}, 
     showfliers=False,whiskerprops={'linewidth':0}) 

plt.show() 

enter image description here