📶 直方图生成器Histogram Maker
粘贴一组数据,按 Sturges、平方根或 Freedman–Diaconis 规则自动分组(组距取整到 1、2、2.5、5 × 10ⁿ),或自定义组数、组距和起点,生成直方图和频数、频率、累计频率表,可下载 SVG 或复制 CSV。Paste your data to build a histogram, with bins from Sturges', the square-root or the Freedman–Diaconis rule (widths rounded to 1, 2, 2.5 or 5 × 10ⁿ) or your own bin count, width and start — plus a table of counts, relative and cumulative frequencies, an SVG download and CSV to copy.
使用说明与常见问题How-to & FAQ
「直方图生成器」是什么?What is the Histogram Maker tool?
粘贴一组数据,按 Sturges、平方根或 Freedman–Diaconis 规则自动分组(组距取整到 1、2、2.5、5 × 10ⁿ),或自定义组数、组距和起点,生成直方图和频数、频率、累计频率表,可下载 SVG 或复制 CSV。Paste your data to build a histogram, with bins from Sturges', the square-root or the Freedman–Diaconis rule (widths rounded to 1, 2, 2.5 or 5 × 10ⁿ) or your own bin count, width and start — plus a table of counts, relative and cumulative frequencies, an SVG download and CSV to copy.
如何使用「直方图生成器」?How do I use the Histogram Maker tool?
在「直方图生成器」中,填写「分组方式」、「组数」、「组距」、「起点(可选)」、「标题(可选)」等参数,结果会随输入实时计算并显示在下方。In the Histogram Maker: Fill in "Binning", "Number of bins", "Bin width", "Start value (optional)", "Title (optional)"; results are recalculated instantly as you type.
组数怎么确定?How is the number of bins chosen?
Sturges 规则:k = ⌈log₂ n⌉ + 1;平方根规则:k = ⌈√n⌉;Freedman–Diaconis 规则:组距 = 2 × IQR ÷ ∛n,对有离群值的数据更稳健。按规则得到的组距再取整到 1、2、2.5、5 × 10ⁿ 这样的整齐数,起点取不大于最小值的组距整数倍。也可以直接指定组数或组距。Sturges' rule: k = ⌈log₂ n⌉ + 1; square-root rule: k = ⌈√n⌉; Freedman–Diaconis: width = 2 × IQR ÷ ∛n, which copes better with outliers. The rule's width is rounded up to a tidy 1, 2, 2.5 or 5 × 10ⁿ, and the start is the largest multiple of the width not above the minimum. You can also set the bin count or width yourself.
边界上的值算哪一组?Which bin gets a value on a boundary?
每组是左闭右开区间 [a, b),边界值归入右边一组;最后一组是闭区间,包含最大值。例如默认数据中的 80 计入 [80, 90)。Each bin is half-open, [a, b), so a boundary value goes in the bin to its right; the last bin is closed and includes the maximum. In the default data, 80 is counted in [80, 90).
直方图和条形图有什么区别?How is a histogram different from a bar chart?
直方图用于连续的数值数据,横轴是相连的数值区间,柱子之间不留空隙,柱高表示落在该区间的个数;条形图用于分类数据。可以下载 SVG 矢量图,或复制 CSV 到表格软件。A histogram is for continuous numeric data: the x-axis is a run of adjacent intervals with no gaps between bars, and bar height is the number of values in each interval. A bar chart is for categories. Download the chart as SVG or copy the table as CSV for a spreadsheet.
计算精度如何?How precise are the results?
「直方图生成器」使用 JavaScript 双精度浮点数(约 15–16 位有效数字);极大或极小的数值可能存在精度误差。The Histogram Maker uses double-precision floating point (about 15–16 significant digits); very large or very small values may lose precision.
「直方图生成器」免费吗?需要注册吗?Is the Histogram Maker free? Do I need an account?
「直方图生成器」完全免费,无需注册或安装,打开网页即可使用,手机和电脑都能用;输入的内容只在你的浏览器本地处理。The Histogram Maker is completely free with no sign-up or install and works on phones and desktops; what you enter is processed only in your browser.