怎么画个箱线图

箱线图或叫箱型图,是一种显示统计分布的图表形式。

步骤

  1. {"smallUrl":"https:\/\/www.zenmeban.com\/images_en\/thumb\/4\/46\/Make-a-Box-Plot-Step-1.jpg\/v4-460px-Make-a-Box-Plot-Step-1.jpg","bigUrl":"https:\/\/www.zenmeban.com\/images\/thumb\/4\/46\/Make-a-Box-Plot-Step-1.jpg\/v4-728px-Make-a-Box-Plot-Step-1.jpg","smallWidth":460,"smallHeight":306,"bigWidth":728,"bigHeight":484,"licensing":"<div class=\"mw-parser-output\"><\/div>"} 1 收集数据。假设我们有1、2、3、4、5五个数据,作为计算的例子。
  2. {"smallUrl":"https:\/\/www.zenmeban.com\/images_en\/thumb\/f\/f2\/Make-a-Box-Plot-Step-2.jpg\/v4-460px-Make-a-Box-Plot-Step-2.jpg","bigUrl":"https:\/\/www.zenmeban.com\/images\/thumb\/f\/f2\/Make-a-Box-Plot-Step-2.jpg\/v4-728px-Make-a-Box-Plot-Step-2.jpg","smallWidth":460,"smallHeight":306,"bigWidth":728,"bigHeight":484,"licensing":"<div class=\"mw-parser-output\"><\/div>"} 2 按照数目顺序排列数据(这样在累积次数图表中更好用,但不是必须的)这里的顺序就是1、2、3、4、5。
  3. {"smallUrl":"https:\/\/www.zenmeban.com\/images_en\/thumb\/5\/51\/Make-a-Box-Plot-Step-3.jpg\/v4-460px-Make-a-Box-Plot-Step-3.jpg","bigUrl":"https:\/\/www.zenmeban.com\/images\/thumb\/5\/51\/Make-a-Box-Plot-Step-3.jpg\/v4-728px-Make-a-Box-Plot-Step-3.jpg","smallWidth":460,"smallHeight":306,"bigWidth":728,"bigHeight":484,"licensing":"<div class=\"mw-parser-output\"><\/div>"} 3 找出中位数。中位数是数据中央位置的数字,或(数据总数是偶数时)中间两个数的平均数。这里的中位数是3,但是如果你还多了一个6,那应该把3、4加起来再除以2得到中位数3.5
  4. {"smallUrl":"https:\/\/www.zenmeban.com\/images_en\/thumb\/c\/c7\/Make-a-Box-Plot-Step-4.jpg\/v4-460px-Make-a-Box-Plot-Step-4.jpg","bigUrl":"https:\/\/www.zenmeban.com\/images\/thumb\/c\/c7\/Make-a-Box-Plot-Step-4.jpg\/v4-728px-Make-a-Box-Plot-Step-4.jpg","smallWidth":460,"smallHeight":306,"bigWidth":728,"bigHeight":484,"licensing":"<div class=\"mw-parser-output\"><\/div>"} 4 找出上、下四分位数,他们分别是比中位数大的数的中位数,和比中位数小的数的中位数。记住这是两组分开的数字。要找出下四分位数,找出1、2的中位数,这就是下四分位数了。同样找4、5的中位数来找到上四分位数。
  5. {"smallUrl":"https:\/\/www.zenmeban.com\/images_en\/thumb\/4\/4c\/Make-a-Box-Plot-Step-5.jpg\/v4-460px-Make-a-Box-Plot-Step-5.jpg","bigUrl":"https:\/\/www.zenmeban.com\/images\/thumb\/4\/4c\/Make-a-Box-Plot-Step-5.jpg\/v4-728px-Make-a-Box-Plot-Step-5.jpg","smallWidth":460,"smallHeight":306,"bigWidth":728,"bigHeight":484,"licensing":"<div class=\"mw-parser-output\"><\/div>"} 5 画个双向线图,这条线要足够长来包括所有数据,就像平常图表一样,数据中间的间隔相等。
  6. {"smallUrl":"https:\/\/www.zenmeban.com\/images_en\/thumb\/d\/d3\/Make-a-Box-Plot-Step-6.jpg\/v4-460px-Make-a-Box-Plot-Step-6.jpg","bigUrl":"https:\/\/www.zenmeban.com\/images\/thumb\/d\/d3\/Make-a-Box-Plot-Step-6.jpg\/v4-728px-Make-a-Box-Plot-Step-6.jpg","smallWidth":460,"smallHeight":306,"bigWidth":728,"bigHeight":484,"licensing":"<div class=\"mw-parser-output\"><\/div>"} 6 标出中位数线和四分位数线。从这些点往上画直线,画到你想要的箱型图高度,把顶端连起来做成箱型图。
  7. 7
  8. 8
  9. {"smallUrl":"https:\/\/www.zenmeban.com\/images_en\/thumb\/9\/9d\/Make-a-Box-Plot-Step-9.jpg\/v4-460px-Make-a-Box-Plot-Step-9.jpg","bigUrl":"https:\/\/www.zenmeban.com\/images\/thumb\/9\/9d\/Make-a-Box-Plot-Step-9.jpg\/v4-728px-Make-a-Box-Plot-Step-9.jpg","smallWidth":460,"smallHeight":306,"bigWidth":728,"bigHeight":484,"licensing":"<div class=\"mw-parser-output\"><\/div>"} {"smallUrl":"https:\/\/www.zenmeban.com\/images_en\/thumb\/9\/9d\/Make-a-Box-Plot-Step-9.jpg\/v4-460px-Make-a-Box-Plot-Step-9.jpg","bigUrl":"https:\/\/www.zenmeban.com\/images\/thumb\/9\/9d\/Make-a-Box-Plot-Step-9.jpg\/v4-728px-Make-a-Box-Plot-Step-9.jpg","smallWidth":460,"smallHeight":306,"bigWidth":728,"bigHeight":484,"licensing":"<div class=\"mw-parser-output\"><\/div>"} {"smallUrl":"https:\/\/www.zenmeban.com\/images_en\/thumb\/8\/81\/Make-a-Box-Plot-Step-7.jpg\/v4-460px-Make-a-Box-Plot-Step-7.jpg","bigUrl":"https:\/\/www.zenmeban.com\/images\/thumb\/8\/81\/Make-a-Box-Plot-Step-7.jpg\/v4-728px-Make-a-Box-Plot-Step-7.jpg","smallWidth":460,"smallHeight":306,"bigWidth":728,"bigHeight":484,"licensing":"<div class=\"mw-parser-output\"><\/div>"} 9 把异常值,或极端值标出来。这些是数据中最大和最小的数字,用点标出,(或用小垂直线标出),大概标在箱型图中间,这里的下端是1,上端是5。
  10. 10
  11. 11
  12. {"smallUrl":"https:\/\/www.zenmeban.com\/images_en\/thumb\/7\/74\/Make-a-Box-Plot-Step-12.jpg\/v4-460px-Make-a-Box-Plot-Step-12.jpg","bigUrl":"https:\/\/www.zenmeban.com\/images\/thumb\/7\/74\/Make-a-Box-Plot-Step-12.jpg\/v4-728px-Make-a-Box-Plot-Step-12.jpg","smallWidth":460,"smallHeight":306,"bigWidth":728,"bigHeight":484,"licensing":"<div class=\"mw-parser-output\"><\/div>"} {"smallUrl":"https:\/\/www.zenmeban.com\/images_en\/thumb\/4\/4c\/Make-a-Box-Plot-Step-11.jpg\/v4-460px-Make-a-Box-Plot-Step-11.jpg","bigUrl":"https:\/\/www.zenmeban.com\/images\/thumb\/4\/4c\/Make-a-Box-Plot-Step-11.jpg\/v4-728px-Make-a-Box-Plot-Step-11.jpg","smallWidth":460,"smallHeight":306,"bigWidth":728,"bigHeight":484,"licensing":"<div class=\"mw-parser-output\"><\/div>"} {"smallUrl":"https:\/\/www.zenmeban.com\/images_en\/thumb\/5\/55\/Make-a-Box-Plot-Step-10.jpg\/v4-460px-Make-a-Box-Plot-Step-10.jpg","bigUrl":"https:\/\/www.zenmeban.com\/images\/thumb\/5\/55\/Make-a-Box-Plot-Step-10.jpg\/v4-728px-Make-a-Box-Plot-Step-10.jpg","smallWidth":460,"smallHeight":306,"bigWidth":728,"bigHeight":484,"licensing":"<div class=\"mw-parser-output\"><\/div>"} 12把异常值和箱型图连起来(即“须”)
  13. {"smallUrl":"https:\/\/www.zenmeban.com\/images_en\/thumb\/d\/d7\/Make-a-Box-Plot-Step-13.jpg\/v4-460px-Make-a-Box-Plot-Step-13.jpg","bigUrl":"https:\/\/www.zenmeban.com\/images\/thumb\/d\/d7\/Make-a-Box-Plot-Step-13.jpg\/v4-728px-Make-a-Box-Plot-Step-13.jpg","smallWidth":460,"smallHeight":306,"bigWidth":728,"bigHeight":484,"licensing":"<div class=\"mw-parser-output\"><\/div>"} 13完成

<<:  怎么清理微波炉

>>:  怎么步行

怎么在酒吧勾搭女孩

在酒吧遇见女生可能很困难,酒吧很吵闹,又拥挤,而且各种活动。事实上,大部分女生不会去酒吧找男生。不过...

怎么装扮得复古

复古穿着从来没有像今天这么流行过。你有近百年的风格可以选择,每个人都可以找到自己喜欢的。到当地的旧货...

怎么清洁白色皮鞋

白色鞋子很难始终保持洁净,如果你经常在户外活动,情况更是如此。白色的皮鞋清洁起来就更加困难了,因为氨...

怎么制作面纱

面纱可用在婚礼、宗教活动中作为特定饰品,也可以用作表演服装,或用于装饰华丽的礼服等。不同的文化及传统...

怎么安全减肥

当前的减肥市场上充斥着各种提供饮食减肥方法的商家,一个个都宣称自己能帮助你快速减肥。大多数商店货架上...