plot-api / jetbrains.letsPlot.geom / geom_histogram

geom_histogram

class geom_histogram : HistogramAesthetics, BinStatAesthetics, BinStatParameters, LayerBase

Display a 1d distribution by dividing variable mapped to x axis into bins and counting the number of observations in each bin.

Parameters

data - dictionary or pandas DataFrame, optional. The data to be displayed in this layer. If None, the default, the data is inherited from the plot data as specified in the call to lets_plot.

stat - string, optional. The statistical transformation to use on the data for this layer, as a string. Supported transformations: "identity" (leaves the data unchanged), "count" (counts number of points with same x-axis coordinate), "bin" (counts number of points with x-axis coordinate in the same bin), "smooth" (performs smoothing - linear default)

position - string, optional. Position adjustment, either as a string ("identity", "stack", "dodge", ...), or the result of a call to a position adjustment function.

x - x-axis value (this values will produce cases or bins for bars).

y - y-axis value (this value will be used to multiply the bar heights), setting y to '..density..' produces normalized (density) histogram.

alpha - transparency level of a layer Understands numbers between 0 and 1.

color - (colour) color of a geometry lines. Can be continuous or discrete. For continuous value this will be a color gradient between two colors.

fill - color of geometry filling.

size - line width. Defines bar line width.

mapping - set of aesthetic mappings. Aesthetic mappings describe the way that variables in the data are mapped to plot "aesthetics".

Constructors

<init>

Display a 1d distribution by dividing variable mapped to x axis into bins and counting the number of observations in each bin.

geom_histogram(data: Map<*, *>? = null, stat: StatOptions = Stat.bin(), position: PosOptions = Pos.stack, showLegend: Boolean = true, sampling: SamplingOptions? = null, x: Double? = null, y: Double? = null, alpha: Number? = null, color: Any? = null, fill: Any? = null, size: Number? = null, weight: Any? = null, bins: Int? = null, binWidth: Number? = null, center: Number? = null, boundary: Number? = null, mapping: HistogramMapping.() -> Unit = {})

Properties

alpha

transparency level of a layer Understands numbers between 0 and 1.

val alpha: Number?

bins

val bins: Int?

binWidth

val binWidth: Number?

boundary

val boundary: Number?

center

val center: Number?

color

(colour) color of a geometry lines. Can be continuous or discrete. For continuous value this will be a color gradient between two colors.

val color: Any?

fill

color of geometry filling.

val fill: Any?

size

line width. Defines bar line width.

val size: Number?

weight

val weight: Any?

x

x-axis value (this values will produce cases or bins for bars).

val x: Double?

y

y-axis value (this value will be used to multiply the bar heights), setting y to '..density..' produces normalized (density) histogram.

val y: Double?

Functions

seal

fun seal(): Options

Extension Functions

toSpec

fun Layer.toSpec(): MutableMap<String, Any>