geom_histogram ¶
geom_histogram(
mapping: FeatureSpec | None = None,
*,
data: PlotData | None = None,
stat: str | None = None,
position: Position | None = None,
show_legend: bool | None = None,
inherit_aes: bool | None = None,
manual_key: ManualKey | None = None,
sampling: Sampling | None = None,
threshold: Number | None = None,
tooltips: Tooltips | None = None,
labels: Labels | None = None,
orientation: str | None = None,
bins: int | None = None,
binwidth: Number | None = None,
center: Number | None = None,
boundary: Number | None = None,
breaks: Breaks | None = None,
color_by: str | None = None,
fill_by: str | None = None,
na_rm: bool | None = None,
**other_args: Any,
) -> LayerSpec
Histogram of binned x values (stat="bin"), stacked.
Parameters:
-
mapping(FeatureSpec, default:None) –Aesthetic mapping from
aes(). -
data(DataFrame or dict, default:None) –Layer data; inherits the plot data when None.
-
stat(str, default:None) –Statistical transformation, by name.
-
position(str or FeatureSpec, default:None) –Position adjustment: a name such as
"dodge"or aposition_*()spec. -
show_legend(bool, default:None) –False hides this layer from the legend.
-
inherit_aes(bool, default:None) –False ignores the plot's default mapping for this layer.
-
manual_key(str or FeatureSpec, default:None) –A legend key for this layer, as in lets_plot; not supported yet (ggrust warns).
-
sampling(str or FeatureSpec, default:None) –lets_plot sampling; accepted and ignored, as ggrust draws every row.
-
threshold(float, default:None) –Densities under this value are not drawn.
-
tooltips(FeatureSpec or list of str, default:None) –Tooltip content:
layer_tooltips(), a list of column names, or"none"to disable tooltips (HTML output). -
labels(list or dict, default:None) –Texts at the breaks: a list, or a dict of break values to texts.
-
orientation(str, default:None) –Set to
"y"to draw the geom along the y axis. -
bins(int, default:None) –Number of bins (30 when neither
binsnorbinwidthis set). -
binwidth(float, default:None) –Width of the bins; overrides
bins. -
center(float, default:None) –A bin center, to align the bins.
-
boundary(float, default:None) –A bin boundary, to align the bins.
-
breaks(list or dict, default:None) –Positions of the ticks or legend keys: a list, or a dict of labels to values.
-
color_by(str, default:None) –Aesthetic the
colorscale applies to ("color"or"fill"). -
fill_by(str, default:None) –Aesthetic the
fillscale applies to ("fill"or"color"). -
na_rm(bool, default:None) –True removes rows with missing values silently; otherwise they are removed with a warning.
-
**other_args(Any) –Constant aesthetics and the geom's options, as in lets_plot.
Returns:
-
LayerSpec–The layer.