| plot_hist | R Documentation |
Histogram for a numeric column using ggplot2.
plot_hist(data, label_x = "", label_y = "", color = "white", alpha = 0.25)
data |
data.frame with one numeric column (first column is used if multiple) |
label_x |
x‑axis label |
label_y |
y‑axis label |
color |
fill color |
alpha |
transparency level (0–1) |
If multiple columns are provided, only the first is used. Breaks are computed via graphics::hist to
mirror base R binning. color controls the fill; alpha the transparency.
returns a ggplot2::ggplot graphic
grf <- plot_hist(iris |> dplyr::select(Sepal.Width), color=c("blue"))
plot(grf)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.