Draw bar chart.
draw_bar(
values,
cates = NULL,
axis = NULL,
groups = length(values),
bar_side = 1,
bar_way = 1,
gap = ifelse(side_label == 1, 0.6, 0.1),
csize = 0.8,
space = 0.9,
adj = -0.01,
gl = TRUE,
label = c("Male", "Female"),
cols = c("#006400", "#b32134"),
side_label = 1,
legend = FALSE,
legend_label = NULL,
dens = c(-1, -1),
overlay = FALSE,
...
)
List of values to be draw.
Categories for the groups.
Axis values.
Groups of the bar chart, default is length of the values list.
Orientation of the bar chart: 1 for left and 2 for right.
Draw the bar chart unidirectionally or bidirectionally, 1 for unidirectionally and 2 for bidirectionally.
The width of center gap. Default is 0.1.
The font size to write the labels on sides. Default is 1.
Space between bars.
The vertical adjustment factor for the labels of age classes. Default is -0.01.
Logical value to draw the vertical dotted lines. Default is TRUE.
Labels for the two sides.
The colors of the bars.
Draw the side label on the left or right. 1 for left and 2 for right.
Logical value indicates plot legend or not.
Character for the legend label.
The density of hatching lines (/inch).
Logical value, TRUE for overlay plot, FALSE for not.
Other options.
A bar chart.