threshold
in geomHistogram()
¶The threshold
parameter controls how the bin
statistic is computed. When threshold=null
(the default), all bins are retained.
When threshold=0
or other numeric value, bins with counts less than or equal to that threshold are dropped.
Dropping empty bins is particularly useful for faceted plots with free scales.
%useLatestDescriptors
%use dataframe
%use lets-plot
LetsPlot.getInfo()
Lets-Plot Kotlin API v.4.9.0. Frontend: Notebook with dynamically loaded JS. Lets-Plot JS v.4.5.1.
val iris = DataFrame.readCSV("https://raw.githubusercontent.com/JetBrains/lets-plot-docs/master/data/iris.csv")
val p = letsPlot(iris.toMap()) {
x = "petal_length"
fill = "species"
} + facetWrap(
facets = "species",
scales = "free_x"
)
free
X-axis¶Despite scales='free_x'
, the x-axis still appears to be shared across the plot facets.
p + geomHistogram()
p + geomHistogram(threshold = 0)