A serializable description of a histogram. Build one with
setup_HistogramConfig() rather than calling this constructor directly.
Usage
HistogramConfig(
dat_path = NULL,
title = NULL,
origin = NULL,
writer = NULL,
legend_position = "top",
legend_placement = "outside",
mode = "overlap",
order = "input",
n = 512L,
bw = "nrd0",
bandwidth = NULL,
kernel = "gaussian",
adjust = 1,
na_rm = TRUE,
fill_alpha = 0.25,
x = NULL,
group = NULL,
breaks = "Sturges",
bins = NULL,
bin_edges = NULL,
normalization = "count",
bin_stat = "count",
bar_mode = "overlay",
density = FALSE,
palette = NULL,
xlab = NULL,
ylab = NULL,
margin_top = NULL,
margin_right = NULL,
margin_bottom = NULL,
margin_left = NULL
)Arguments
- dat_path
Optional Character: Path to the data, read at draw time. The serializable alternative to passing
datatodraw().- title
Optional Character: Chart title. Declared here because it is the one property every chart type has;
paletteis not (four take acolormapinstead), and axis labels and margins are cartesian-only.- origin
Optional Named character {"user", "default", "derived"}: Where each value came from, one entry per settable property. Absent on an authored config; written by the interface that resolved it.
- writer
Optional Named character: Which interface wrote the config, as
nameandversion. Absent on an authored config.- legend_position
Character {"top", "bottom", "left", "right", "top-left", "top-right", "bottom-left", "bottom-right"}: Legend anchor. Top/bottom anchors use horizontal rows; left/right anchors use a vertical column. Corner anchors align within the top or bottom row.
- legend_placement
Character {"outside", "inside"}: Relation to the plotting area. Outside placement reserves space for the complete legend; inside placement overlays the data. Neither setting adds a missing legend.
- mode
Character
{"overlap", "ridge"}: Overlay samples or align rows on common x and y scales. Ridge rows use sample names in place of a legend. Increase figure height for many rows.- order
Character
{"input", "mean", "median"}: Sample order. Summary orders are decreasing, retain ties in input order, and place empty samples last.- n
Integer
[2, Inf): Number of density evaluation points.- bw
Character or Numeric: Bandwidth selector (
"nrd0","nrd","ucv","bcv","SJ","SJ-ste","SJ-dpi"). Numeric input is normalized tobandwidthby the setup function.- bandwidth
Optional Numeric
(0, Inf): Explicit finite smoothing bandwidth in measurement units, overriding the selector.- kernel
Character: One of
"gaussian","epanechnikov","rectangular","triangular","biweight","cosine", or"optcosine".- adjust
Numeric
(0, Inf): Finite bandwidth multiplier.- na_rm
Logical: Whether to remove
NAvalues before computing densities.- fill_alpha
Numeric
[0, 1]: Distribution fill opacity.- x
Optional Character: Columns to bin, one distribution per column.
- group
Optional Character: Column to split the bins by.
- breaks
Numeric, Character, or Numeric vector: Binning method. A single number (number of bins), a character string naming an algorithm (e.g.
"Sturges","Scott","FD"), or a numeric vector of break points. Numeric forms are normalized tobinsorbin_edgesby the setup function. Bin counts are suggestions tohist().- bins
Optional Integer
[1, 1000000]: Suggested bin count.- bin_edges
Optional Numeric vector: Finite, strictly increasing edges spanning every retained observation. Overrides
breaks; excludesbins.- normalization
Character:
"count","probability","percent","density", or"count_density".- bin_stat
Character
{"count", "sum", "mean", "min", "max"}: Statistic of x observations in each bin. Empty bins have height zero. Non-count statistics require normalization = "count" and density = FALSE.- bar_mode
Character
{"overlay", "group", "stack"}: Histogram group layout. Stacks accumulate positive and negative values separately. Group/stack layouts require mode = "overlap" and density = FALSE.- density
Logical: Overlay a kernel density in histogram units.
- palette
Optional Character: Series colors, overriding the theme palette for this chart.
NULLuses the theme's.- xlab, ylab
Optional Character: Axis labels.
NULLderives them from the data.- margin_top, margin_right, margin_bottom, margin_left
Optional Integer
[0, Inf): Plot margins in pixels.