# 茎叶图

茎叶图（stem-and-leaf display，亦称 stemplot）是一种展示定量数据的方法：将每个数据值拆分为一个“茎”（除最右位数字之外的全部数字）和一个“叶”（最右位数字），叶按顺序写在对应茎的旁边，使图形既能显示分布的形状，又保留了每一个具体数值。<sup>[1](https://www.pearson.com/channels/statistics/study-guides/organizing-quantitative-data-histograms-dotplots-and-stem)</sup> 该技术是探索性数据分析的标准工具，见于统计学入门课程以及 R、Stata、SPSS、Dataplot 等统计软件中。<sup>[2](https://search.r-project.org/R/refmans/graphics/html/stem.html)</sup><sup> • </sup><sup>[3](https://www.stata.com/manuals/rstem.pdf)</sup>

| 关键事实 | 详情 |
|---|---|
| 构造方法 | 每个值拆分为茎（除最右位数字之外的全部数字）与叶（最右位数字）；茎按顺序沿左侧纵向排列，叶也按顺序写在茎旁。<sup>[1](https://www.pearson.com/channels/statistics/study-guides/organizing-quantitative-data-histograms-dotplots-and-stem)</sup> |
| 保留的信息 | 与直方图不同，每一个原始数据值都可从图中还原；将图形逆时针旋转 90 度，即得到类似直方图的轮廓。<sup>[4](https://www.varsitytutors.com/practice/subjects/ap-physics-1/lessons/histograms-and-distribution-plots)</sup> |
| 最佳数据规模 | 通常适用于不超过 200 个观测值的数据集；数据量很大时，叶行会变得冗长难理，此时直方图是更好的概括方式。<sup>[5](https://www.bigm.edu.bd/public/upload/library/books_publications/20220629_1656485225.pdf)</sup><sup> • </sup><sup>[6](https://www.statslearn.org/compare/dotplot-vs-histogram-vs-stemplot)</sup> |
| 名称由来 | 可归功于约翰·W·图基（John W. Tukey，1972、1977）；基本思想出现更早，包括达德利（Dudley，1946）以及塔夫特（Tufte，1990）复制过的日本铁路时刻表。<sup>[7](https://journals.sagepub.com/doi/pdf/10.1177/1536867X0700700308)</sup> |
| 组间比较 | 两组数据可用共享一列茎的背靠背茎叶图进行比较。<sup>[6](https://www.statslearn.org/compare/dotplot-vs-histogram-vs-stemplot)</sup> |
| 软件 | R 的 `stem(x, scale = 1, width = 80, atom = 1e-08)` 会丢弃无穷值与缺失值；Stata 的 `stem` 提供 `round()`、`truncate()`、`digits()`、`lines()`、`width()` 和 `prune` 选项。<sup>[2](https://search.r-project.org/R/refmans/graphics/html/stem.html)</sup><sup> • </sup><sup>[3](https://www.stata.com/manuals/rstem.pdf)</sup> |

## 构造方法

要构造茎叶图，分析者先画出覆盖数据范围的纵向茎轴，然后逐个处理每个数值，把它的叶写进以对应茎为行首的那一行。例如，数值 111 拆分为茎 11、叶 1，85 拆分为茎 8、叶 5。<sup>[8](https://online.stat.psu.edu/stat414/Lesson13)</sup> 诸如“9\|0 = 90”的图例说明小数点的位置，而“x 10”之类的轴乘数则让读者能解读每个数值。<sup>[9](https://openbooks.macewan.ca/introstats/chapter/1-4-organizing-data/)</sup><sup> • </sup><sup>[10](https://www.sjsu.edu/faculty/gerstman/StatPrimer/freq.htm)</sup>

**读图。** 由于各行相当于横放的条形，图形在列出数据的同时显示了分布的形状、中心与离散程度。从一张由 64 个智商分数构成的完整茎叶图中，读者可以看出分布呈钟形，多数数值落在 90—99 和 100—109 这两个区间，最小值为 68，最大值为 141。<sup>[8](https://online.stat.psu.edu/stat414/Lesson13)</sup> 有序排列也使中位数、四分位数等顺序统计量摘要的手工计算变得简便。<sup>[7](https://journals.sagepub.com/doi/pdf/10.1177/1536867X0700700308)</sup>

**拆分茎。** 当一个茎积累的叶过多时，可将每个茎重复为两行或多行：第一行放叶 0 至 4，第二行放 5 至 9；若数据更密集，则每个茎用五行，分别把叶 0 和 1、2 和 3 等归为一组。<sup>[10](https://www.sjsu.edu/faculty/gerstman/StatPrimer/freq.htm)</sup><sup> • </sup><sup>[11](https://www.statslearn.org/guides/how-to-read-a-stemplot)</sup> 在 Stata 的五分行标注中，字母 t、f、s 分别标记叶为二或三、四或五、六或七的行。<sup>[7](https://journals.sagepub.com/doi/pdf/10.1177/1536867X0700700308)</sup> 位数较多的数据可通过四舍五入到两三位有效数字、使用两位或多位叶、或重新缩放来处理；例如 Stata 的 `round(100)` 选项把 3,291 美元的汽车价格显示为 3,300 美元。<sup>[7](https://journals.sagepub.com/doi/pdf/10.1177/1536867X0700700308)</sup><sup> • </sup><sup>[3](https://www.stata.com/manuals/rstem.pdf)</sup>

## 与直方图和点图的比较

直方图、茎叶图和点图都按从小到大自然顺序展示一个定量变量的分布，让读者判断形状、中心与离散程度。三者之间的选择主要取决于数据规模以及需要保留多少原始数据：点图用点标记每个值，适合小数据集；茎叶图以数字形式保留每个值，适合小到中等数据集；直方图把数值分组到区间，能处理大数据集，代价是丢失个体数值。<sup>[6](https://www.statslearn.org/compare/dotplot-vs-histogram-vs-stemplot)</sup>

茎叶图相对于直方图的决定性优势在于原始数据仍可还原；分组数据的直方图丢失了个体测量值，而茎叶图展示每一个观测值，因而显示了直方图所丢弃的信息。<sup>[4](https://www.varsitytutors.com/practice/subjects/ap-physics-1/lessons/histograms-and-distribution-plots)</sup> 保留的细节还有助于检查离群值、极端值以及由数字偏好造成的粒度。<sup>[7](https://journals.sagepub.com/doi/pdf/10.1177/1536867X0700700308)</sup> 其主要局限正是同一性质的反面：数据量大时行会变得很长，图形变得笨拙甚至不可行；除非将两个或多个图按共同尺度并排对齐，否则难以比较。<sup>[7](https://journals.sagepub.com/doi/pdf/10.1177/1536867X0700700308)</sup> 共享一列茎的背靠背茎叶图是两组比较的标准补救办法。<sup>[6](https://www.statslearn.org/compare/dotplot-vs-histogram-vs-stemplot)</sup>

## 历史

茎叶图是探索性数据分析（EDA）的产物——这套态度与技术主要由约翰·W·图基自 1970 年前后发展起来，用于灵活地、以图形为主地探查数据。<sup>[12](https://doi.org/10.1002/9781118445112.stat00419.pub2)</sup> 图基 1977 年由 Addison-Wesley 出版的《探索性数据分析》（*Exploratory Data Analysis*）一书，开篇章节即题为“草草记下数字（茎叶图）”。<sup>[13](https://books.google.com/books/about/Exploratory_Data_Analysis.html?hl=en&id=Fz5DnwEACAAJ&output=html_text)</sup> 统计学家尼古拉斯·J·考克斯（Nicholas J. Cox）是皇家统计学会会士，以其在《Stata 杂志》上关于统计图形的专栏而知名；他指出该名称可归功于图基 1972 年和 1977 年的著作，其广泛使用源于图基的倡导，而基本思想出现于更早的文献，包括达德利（1946）以及爱德华·塔夫特（Edward Tufte）在《构想信息》（*Envisioning Information*，1990）中复制的日本铁路时刻表。<sup>[7](https://journals.sagepub.com/doi/pdf/10.1177/1536867X0700700308)</sup><sup> • </sup><sup>[3](https://www.stata.com/manuals/rstem.pdf)</sup>

自动化紧随其后。独立咨询师、《理解稳健与探索性数据分析》（*Understanding Robust and Exploratory Data Analysis*）联合主编戴维·C·霍格林（David C. Hoaglin）与印第安纳大学的斯坦利·沃瑟曼（Stanley Wasserman）于 1975 年发表工作论文，提出了自动生成合理茎叶图的算法，包括使用多少行的规则，并为此给出了半可移植的 FORTRAN 子程序。<sup>[14](https://www.researchgate.net/publication/5183699_Notes_on_Automating_Stem_and_Leaf_Displays)</sup> 爱默生（Emerson）与霍格林 1983 年在《理解稳健与探索性数据分析》中的“茎叶图”一章，至今仍是软件文档中引用的标准参考文献。<sup>[3](https://www.stata.com/manuals/rstem.pdf)</sup>

## 软件实现

统计软件包以可调参数实现茎叶图。R 图形包中的 `stem()` 函数接受一个数值向量，参数包括 `scale`（控制图形长度，`scale = 2` 大致使长度加倍）、`width`（期望的图形宽度，默认 80）和 `atom`（容差，默认 1e-08）；无穷值与缺失值会被丢弃，函数返回不可见的 NULL。<sup>[2](https://search.r-project.org/R/refmans/graphics/html/stem.html)</sup> Stata 的 `stem` 提供 `round()` 和 `truncate()` 用于重新缩放数据，`digits()` 指定每片叶的位数（默认 1），`lines()` 或等效的 `width()` 指定每个区间的茎数，`prune` 用于抑制空茎；当既未给出 `lines()` 也未给出 `width()` 时，软件自动选择取值。<sup>[3](https://www.stata.com/manuals/rstem.pdf)</sup> 在 SPSS 中，茎叶图通过“统计 | 汇总 | 探索”生成。<sup>[10](https://www.sjsu.edu/faculty/gerstman/StatPrimer/freq.htm)</sup> 美国国家标准与技术研究院（NIST）的 Dataplot 是由詹姆斯·J·菲利本（James J. Filliben）于 1978 年首次发布的公有领域系统，其分布图形中包含茎叶图。<sup>[15](https://itl.nist.gov/div898/software/dataplot/)</sup><sup> • </sup><sup>[16](https://www.itl.nist.gov/div898/software/dataplot/tutorial.htm)</sup>

## 在教学与研究中的使用

茎叶图仍是统计学教学的标准内容：AP 统计学课程第一单元第 1.5 节将直方图、茎叶图和点图列为单个定量变量的图形表示，背靠背茎叶图则作为比较两个分布的图形出现。<sup>[6](https://www.statslearn.org/compare/dotplot-vs-histogram-vs-stemplot)</sup><sup> • </sup><sup>[11](https://www.statslearn.org/guides/how-to-read-a-stemplot)</sup> 圣地亚哥州立大学的琳达·L·库珀（Linda L. Cooper）与洛约拉马利蒙特大学的费利斯·S·肖尔（Felice S. Shore）发表在《统计学教育杂志》（*Journal of Statistics Education*）上的一项研究，调查了本科生对这类图形的解读：74% 的学生熟悉茎叶图，而熟悉直方图的比例为 94%，但更多学生能从茎叶图中成功求出平均数和中位数——52% 正确求出中位数，62% 正确求出平均数——作者将此与原始数值易于提取联系起来。<sup>[17](https://jse.amstat.org/v16n2/Cooper.html)</sup>

从业者对茎叶图当前作用的看法不一。考克斯表示，他随时间推移越来越少使用茎叶图，因为按通常的实现方式，它们不如点图或条带图灵活，但他认为其局限并不排除其有用性。<sup>[7](https://journals.sagepub.com/doi/pdf/10.1177/1536867X0700700308)</sup> 美国统计协会社区在 2018 年讨论过的 Python 包 stemgraphic 将该思想从数值数据扩展到分类数据和文本。<sup>[18](https://community.amstat.org/communities/community-home/digestviewer/viewthread?CommunityKey=6b2d607a-e31f-4f19-8357-020a8631b999&GroupId=2653&MessageKey=acb788c6-f79e-45d5-ac41-ce19ed219453&hlmlt=VT&tab=digestviewer)</sup>

## References

1. [Organizing Quantitative Data: Histograms, Dotplots, and Stem-and-Leaf Displays, Pearson study guide](https://www.pearson.com/channels/statistics/study-guides/organizing-quantitative-data-histograms-dotplots-and-stem)
2. [stem {graphics}, R Documentation](https://search.r-project.org/R/refmans/graphics/html/stem.html)
3. [stem, Stata Base Reference Manual](https://www.stata.com/manuals/rstem.pdf)
4. [Histograms & Distribution Plots, Varsity Tutors](https://www.varsitytutors.com/practice/subjects/ap-physics-1/lessons/histograms-and-distribution-plots)
5. [Online Statistics Education (PDF)](https://www.bigm.edu.bd/public/upload/library/books_publications/20220629_1656485225.pdf)
6. [Dotplot vs histogram vs stemplot: how to choose, StatsLearn](https://www.statslearn.org/compare/dotplot-vs-histogram-vs-stemplot)
7. [N. J. Cox (2007). Speaking Stata: Turning over a New Leaf. Stata Journal 7(3)](https://journals.sagepub.com/doi/pdf/10.1177/1536867X0700700308)
8. [Lesson 13: Exploring Continuous Data, STAT 414, Penn State](https://online.stat.psu.edu/stat414/Lesson13)
9. [1.4 Organizing Data, Introduction to Applied Statistics, MacEwan Open Books](https://openbooks.macewan.ca/introstats/chapter/1-4-organizing-data/)
10. [Stem-and-Leaf Plots, Frequency Tables, and Histograms, SJSU StatPrimer](https://www.sjsu.edu/faculty/gerstman/StatPrimer/freq.htm)
11. [How to read and make a stemplot, StatsLearn](https://www.statslearn.org/guides/how-to-read-a-stemplot)
12. [David C. Hoaglin (2017). Exploratory Data Analysis. Wiley StatsRef](https://doi.org/10.1002/9781118445112.stat00419.pub2)
13. [John W. Tukey (1977). Exploratory Data Analysis. Addison-Wesley, 688 pages](https://books.google.com/books/about/Exploratory_Data_Analysis.html?hl=en&id=Fz5DnwEACAAJ&output=html_text)
14. [David C. Hoaglin and Stanley S. Wasserman (1975). Notes on Automating Stem and Leaf Displays. NBER Working Paper No. 109](https://www.researchgate.net/publication/5183699_Notes_on_Automating_Stem_and_Leaf_Displays)
15. [Dataplot Homepage, NIST](https://itl.nist.gov/div898/software/dataplot/)
16. [Dataplot Tutorial, NIST](https://www.itl.nist.gov/div898/software/dataplot/tutorial.htm)
17. [Linda L. Cooper and Felice S. Shore (2008). Students' Misconceptions in Interpreting Center and Variability of Data Represented via Histograms and Stem-and-Leaf Plots. Journal of Statistics Education 16(2)](https://jse.amstat.org/v16n2/Cooper.html)
18. [Tool for stem-and-leaf plots: stemgraphic, ASA Connect](https://community.amstat.org/communities/community-home/digestviewer/viewthread?CommunityKey=6b2d607a-e31f-4f19-8357-020a8631b999&GroupId=2653&MessageKey=acb788c6-f79e-45d5-ac41-ce19ed219453&hlmlt=VT&tab=digestviewer)

---
*Initially written Sep 17, 2026 · Reviewed: Oct 15, 2026 · Edited: Oct 15, 2026 · Last review: Oct 15, 2026*

Topic: 物质世界与数学 › 数学与统计学 › 统计学与概率论 › Applied, official, and domain statistics › Computational statistics › Statistical graphics and computational data visualization

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/stem-and-leaf-display

English original: https://www.edgepedia.org/stem-and-leaf-display
