powered by
Create a bar plot using the aelab theme.
plot_bar( df, x, y, z = NULL, base_size = 25, line_width = 1, text_color = "black", facet = FALSE, facet_x = NULL, facet_y = NULL, style = "bw", position = "dodge", stat = "identity" )
A ggplot object.
ggplot
A data frame.
<[`data-masking`][ggplot2::aes]> Column mapped to the x-axis.
<[`data-masking`][ggplot2::aes]> Column mapped to the y-axis.
<[`data-masking`][ggplot2::aes]> Optional column mapped to fill colour.
Base font size. Default 25.
Bar outline width. Default 1.
Text colour. Default "black".
"black"
Logical; add facet grid? Default FALSE.
FALSE
Column name (string) for the horizontal facet dimension.
Column name (string) for the vertical facet dimension.
Theme style. Default "bw".
"bw"
Bar position: "dodge" or "stack". Default "dodge".
"dodge"
"stack"
Stat type: "identity" or "count". Default "identity".
"identity"
"count"
if (FALSE) { df <- data.frame(x = c("A","B","A","B"), g = c("X","X","Y","Y"), y = c(1,2,3,4)) plot_bar(df, x, y, g) }
Run the code above in your browser using DataLab