Draw a bar plot with variable widths

area_bar_plot(data, xname, yname, fillname, gap_fixed = 1)

Arguments

data

to be plotted

xname

variable name for x axis (and widths)

yname

variable name for y axis (and heights)

fillname

variable name for fill colors

gap_fixed

a fixed gap width (in units of x)

The standard ggplot2::geom_bar/geom_col has a width argument, but this argument does not affect the placement of the bars, so they quickly overlap. In addition, no x axis is displayed.