boxplot

boxplot
Definition : boxplot(x, notch=False, sym=‘b+‘, vert=True, whis=1.5, positions=None, widths=None, patch_artist=False, bootstrap=None, usermedians=None, conf_intervals=None, hold=None)

Type : Function of matplotlib.pyplot module

Make a box and whisker plot.

Call signature:

boxplot(x, notch=False, sym=‘+‘, vert=True, whis=1.5,
        positions=None, widths=None, patch_artist=False,
        bootstrap=None, usermedians=None, conf_intervals=None)
Make a box and whisker plot for each column of x or each vector in sequence x. The box extends from the lower to upper quartile values of the data, with a line at the median. The whiskers extend from the box to show the range of the data. Flier points are those past the end of the whiskers.

Function Arguments:

x :
Array or a sequence of vectors.
notch : [ False (default) | True ]
If False (default), produces a rectangular box plot. If True, will produce a notched box plot
sym : [ default ‘b+’ ]
The default symbol for flier points. Enter an empty string (‘’) if you don’t want to show fliers.
vert : [ False | True (default) ]
If True (default), makes the boxes vertical. If False, makes horizontal boxes.
whis : [ default 1.5 ]
Defines the length of the whiskers as a function of the inner quartile range. They extend to the most extreme data point within ( whis*(75%-25%) ) data range.
bootstrap : [ None (default) | integer ]
Specifies whether to bootstrap the confidence intervals around the median for notched boxplots. If bootstrap==None, no bootstrapping is performed, and notches are calculated using a Gaussian-based asymptotic approximation (see McGill, R., Tukey, J.W., and Larsen, W.A., 1978, and Kendall and Stuart, 1967). Otherwise, bootstrap specifies the number of times to bootstrap the median to determine it’s 95% confidence intervals. Values between 1000 and 10000 are recommended.
usermedians : [ default None ]
An array or sequence whose first dimension (or length) is compatible with x. This overrides the medians computed by matplotlib for each element of usermedians that is not None. When an element of usermedians == None, the median will be computed directly as normal.
conf_intervals : [ default None ]
Array or sequence whose first dimension (or length) is compatible with x and whose second dimension is 2. When the current element of conf_intervals is not None, the notch locations computed by matplotlib are overridden (assuming notch is True). When an element of conf_intervals is None, boxplot compute notches the method specified by the other kwargs (e.g., bootstrap).
positions : [ default 1,2,...,n ]
Sets the horizontal positions of the boxes. The ticks and limits are automatically set to match the positions.
widths : [ default 0.5 ]
Either a scalar or a vector and sets the width of each box. The default is 0.5, or 0.15*(distance between extreme positions) if that is smaller.
patch_artist : [ False (default) | True ]
If False produces boxes with the Line2D artist If True produces boxes with the Patch artist
Returns a dictionary mapping each component of the boxplot to a list of the matplotlib.lines.Line2D instances created. That dictionary has the following keys (assuming vertical boxplots):

boxes: the main body of the boxplot showing the quartiles and the median’s confidence intervals if enabled.
medians: horizonal lines at the median of each box.
whiskers: the vertical lines extending to the most extreme, n-outlier data points.
caps: the horizontal lines at the ends of the whiskers.
fliers: points representing data that extend beyone the whiskers (outliers).
Example:

Additional kwargs: hold = [True|False] overrides default hold state

 以上为帮助说明,比较蛋疼的是http://matplotlib.org/api/pyplot_api.html, 官网上大量的参数都写得是不能用。是不是我的版本太低了。showXXXX等等。

简而言之:

  x: list of lists.

  notch: 豁口有无

  sym: symbol, 异常值,不想要就赋成空字符。

  vert: vertical

  whis: 异常值设定。

  bootstrap: 次数

  usermedians: length等于list, 人为设定(是不是为数据造假准备的?)。

  别的看重要再补上。

demo:

http://matplotlib.org/examples/pylab_examples/boxplot_demo2.html

http://matplotlib.org/examples/pylab_examples/boxplot_demo.html

时间: 2024-10-11 16:45:34

boxplot的相关文章

How to Change the Size of a Box-Plot Label in MATLAB

Type "load carsmall" to load a sample data set included with MATLAB. Type "boxplot(Horsepower,Origin)" to generate a box plot of auto horsepower grouped by country of origin. Type "set(findobj(gca,'Type','text'),'fontunits','point

Matlab boxplot for Multiple Groups(多组数据的箱线图)

在画之前首先介绍一下Matlab boxplot,下面这段说明内容来自http://www.plob.org/2012/06/10/2153.html 由于matlab具有强大的计算功能,用其统计数据功能优点显而易见,这里分享使用matlab中的boxplot的一些技巧,供大家参考. Matlab boxplot命令 格式如下 boxplot(X):产生矩阵X的每一列的盒图和“须”图,“须”是从盒的尾部延伸出来,并表示盒外数据长度的线,如果“须”的外面没有数据,则在“须”的底部有一个点. www

R语言boxplot绘图函数

boxplot 用于绘制箱线图,我们都知道boxplot 用于展示一组数据的总体分布,在R语言中,支持两种输入数据的方式 第一种:x , 这个参数指定用于绘制箱线图所用的数据,是一个向量 代码示例: boxplot(1:100) 效果图如下: 第二种, 通多formala 和 data 两个参数指定,适合展示多组数据的分布 代码示例: dataset <- data.frame(value = rep(1:100, times = 2), group = factor(rep(c("A&q

matplotlib basic and boxplot

============================================matplotlib 绘图基础============================================绘图: matplotlib核心剖析http://www.cnblogs.com/vamei/archive/2013/01/30/2879700.html Python图表绘制:matplotlib绘图库入门http://www.cnblogs.com/wei-li/archive/2012

matlab中boxplot字体大小设置

网上找到的:set(findobj(gca,'Type','text'),'FontSize',18) boxplot() uses the default axes labeling for the Y axes, but for the X axes, it uses text() to put the labels in place and it does not grab the axes FontSize when it does so. Note: it is likely that

盒图(boxplot)

最近在摆弄数据离散度的时候遇到一种图形,叫做盒图(boxplot).它对于显示数据的离散的分布情况效果不错. 盒图是在1977年由美国的统计学家约翰·图基(John Tukey)发明的.它由五个数值点组成:最小值(min),下四分位数(Q1),中位数(median),上四分位数(Q3),最大值(max).也可以往盒图里面加入平均值(mean).如上图.下四分位数.中位数.上四分位数组成一个"带有隔间的盒子".上四分位数到最大值之间建立一条延伸线,这个延伸线成为"胡须(whis

How draw a stem -and -leaf &amp;amp; box-plot display by R.or Python

参考: 使用R进行数据可视化套路之-茎叶图.盒形图 step by step R 读取数据 在网上下载的2013全国各省区GDP排名(exl文件) 先 另存为 data.txt(为了方便存到D盘文件夹下) 參考:R?读?取?t?x?t?,?e?x?c?e?l?数?据 (百度文库里的) > data<-read.table("D:\\data.txt",header=T) > data 算是读取出来了.. . nest step 画 箱线图 函数boxplot(x) ?

ggplot的boxplot添加显著性 | Add P-values and Significance Levels to ggplots

参考:Add P-values and Significance Levels toggplots 代码例子: options(repr.plot.width=7, repr.plot.height=6) # facet boxplot bp <- ggplot(expr_data2, aes(x=group, y=expression, fill=NA)) + geom_boxplot(outlier.size=NA, size=0.01, outlier.shape = NA) + geom

python可视化---箱线图boxplot()

函数功能:绘制箱线图. 调用签名:plt.boxplot(x) x:绘制箱线图的输入数据 代码实现: import matplotlib.pyplot as plt import matplotlib as mpl import numpy as np mpl.rcParams["font.sans-serif"] = ["FangSong"] mpl.rcParams["axes.unicode_minus"] = False x = np.r