{
  "name": "Histogram bin specifications across SAS, R and Matplotlib",
  "description": "Original comparison of documented bin-location and scale controls compiled from SAS procedure documentation and binning guidance, the R graphics manual and the Matplotlib API reference. Each row names its source keys; sources were checked on 2026-11-16.",
  "page": "https://casrai.org/guides/histogram-in-sas",
  "publisher": "CASRAI",
  "license": "https://creativecommons.org/licenses/by/4.0/",
  "dateModified": "2026-11-24T08:20:00Z",
  "temporalCoverage": null,
  "spatialCoverage": null,
  "columns": [
    {
      "name": "Method",
      "unit": "",
      "description": ""
    },
    {
      "name": "Bin-location controls",
      "unit": "",
      "description": ""
    },
    {
      "name": "Scale control",
      "unit": "",
      "description": ""
    },
    {
      "name": "Documented caveat",
      "unit": "",
      "description": ""
    },
    {
      "name": "Source keys",
      "unit": "",
      "description": ""
    }
  ],
  "rows": [
    {
      "Method": "SAS PROC SGPLOT",
      "Bin-location controls": "BINSTART= first center; BINWIDTH= width",
      "Scale control": "SCALE=COUNT, PERCENT or PROPORTION; default PERCENT",
      "Documented caveat": "NBINS= overrides BINWIDTH=; the displayed bin count may be adjusted",
      "Source keys": "sgplot; bins"
    },
    {
      "Method": "SAS PROC UNIVARIATE",
      "Bin-location controls": "HISTOGRAM MIDPOINTS= centers or ENDPOINTS= boundaries",
      "Scale control": "HISTOGRAM VSCALE= controls vertical scale",
      "Documented caveat": "An ENDPOINTS= list may be extended to accommodate the data",
      "Source keys": "univariate; bins"
    },
    {
      "Method": "R graphics hist()",
      "Bin-location controls": "breaks= vector specifies bin boundaries",
      "Scale control": "freq=TRUE gives counts; freq=FALSE gives area density",
      "Documented caveat": "Default right=TRUE makes intervals right-closed; include.lowest governs an extreme boundary",
      "Source keys": "r"
    },
    {
      "Method": "Matplotlib pyplot.hist()",
      "Bin-location controls": "bins= sequence specifies bin edges",
      "Scale control": "density=False gives counts; density=True gives area density",
      "Documented caveat": "Bins are left-closed and right-open except the final bin, which includes its right edge",
      "Source keys": "mpl"
    }
  ],
  "sources": [
    {
      "title": "sgplot: SAS: SGPLOT HISTOGRAM Statement",
      "url": "https://support.sas.com/documentation/cdl/en/grstatproc/65235/HTML/default/n17xrpcduau1f8n1c1nhe477pv18.htm",
      "accessed": "2026-11-16"
    },
    {
      "title": "bins: SAS: Choosing bins for histograms in SAS",
      "url": "https://blogs.sas.com/content/iml/2014/08/25/bins-for-histograms.html",
      "accessed": "2026-11-16"
    },
    {
      "title": "univariate: SAS: UNIVARIATE HISTOGRAM Statement",
      "url": "https://support.sas.com/documentation/cdl/en/procstat/66703/HTML/default/procstat_univariate_syntax09.htm",
      "accessed": "2026-11-16"
    },
    {
      "title": "r: R: Histograms",
      "url": "https://stat.ethz.ch/R-manual/R-devel/library/graphics/html/hist.html",
      "accessed": "2026-11-16"
    },
    {
      "title": "mpl: Matplotlib: matplotlib.pyplot.hist",
      "url": "https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.hist.html",
      "accessed": "2026-11-16"
    }
  ]
}