箱图

参数描述
x : Array or a sequence of vectors.输入的数据
notch : bool, optional (False)If True, will produce a notched box plot. Otherwise, a rectangular boxplot is produced. The notches represent the confidence interval (CI) around the median. See the entry for the bootstrap parameter for information regarding how the locations of the notches are computed.
sym : str, optionalThe default symbol for flier points. Enter an empty string (‘’) if you don’t want to show fliers. If None, then the fliers default to ‘b+’ If you want more control use the flierprops kwarg.
vert : bool, optional (True)控制箱图的方向,True 垂直;False 水平
whis : float, sequence, or string (default = 1.5)As a float, determines the reach of the whiskers to the beyond the first and third quartiles.
bootstrap : int, optionalSpecifies whether to bootstrap the confidence intervals around the median for notched boxplots.
usermedians : array-like, optionalAn array or sequence whose first dimension (or length) is compatible with x.
conf_intervals : array-like, optionalArray or sequence whose first dimension (or length) is compatible with x and whose second dimension is 2.
positions : array-like, optional多个箱图的位置,传入x轴的横坐标
widths : scalar or array-like设置多个箱图的宽度
patch_artist : bool, optional (False)If False produces boxes with the Line2D artist. Otherwise, boxes and drawn with Patch artists.
labels : sequence, optional箱图的标签
manage_xticks : bool, optional (True)If the function should adjust the xlim and xtick locations.
autorange : bool, optional (False)When True and the data are distributed such that the 25th and 75th percentiles are equal, whis is set to ‘range’ such that the whisker ends are at the minimum and maximum of the data.
meanline : bool, optional (False)If True (and showmeans is True), will try to render the mean as a line spanning the full width of the box according to meanprops (see below).
zorder : scalar, optional (None)Sets the zorder of the boxplot.
showcaps : bool, optional (True)在whiskers尾部展示caps
showbox : bool, optional (True)展示中间的箱子
showfliers : bool, optional (True)展示outliers beyond the caps.
showmeans : bool, optional (False)展示arithmetic means.
capprops : dict, optional (None)指定caps的样式
boxprops : dict, optional (None)指定box的样式
whiskerprops : dict, optional (None)指定whiskers的样式
flierprops : dict, optional (None)指定fliers样式
medianprops : dict, optional (None)指定median样式
返回
result : dict返回包含了line2D实例的字典。包含了boxes,medians,whiskers,caps,fliers,means
import pandas as pd
import matplotlib.pyplot as plt
dic = {
    "a":[1,2,3,4,5],
    "b":[2.7,2.5,3,3.5,3.7],
    "c":[3,3,3,3,3]
}

df = pd.DataFrame(dic,columns=['大方差','中方差','小方差'])
df.describe()

a =df.plot.box(color='k')
plt.grid(False)
plt.show()
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值