Estimate figure height for a horizontal bar chart
Source:R/fig_height_h_barchart.R
fig_height_h_barchart2.Rd
Taking an object from makeme()
, this function estimates the height of a
figure for a horizontal bar chart.
Usage
fig_height_h_barchart2(
ggobj,
freq = FALSE,
x_axis_label_width = 20,
strip_angle = 0,
main_font_size = 8,
legend_location = c("panel", "plot"),
n_legend_lines = 2,
legend_key_chars_equivalence = 5,
max_chars_per_figure_width = 100,
multiplier_per_horizontal_line = NULL,
multiplier_per_vertical_letter = 0.01,
multiplier_per_facet = 0.95,
multiplier_per_legend_line = 1.5,
fixed_constant = 0,
figure_width_in_cm = 16,
margin_in_cm = 0,
max = 8,
min = 1
)
Arguments
- ggobj
ggplot2
-object- freq
Logical. If TRUE, frequency plot with categories next to each other. If FALSE (default), proportion plot with stacked categories.
- x_axis_label_width
Numeric. Width allocated for x-axis labels.
- strip_angle
Integer. Angle of the strip text.
- main_font_size
Numeric. Font size for the main text.
- legend_location
Character. Location of the legend ("panel" or "plot").
- n_legend_lines
Integer. Number of lines in the legend.
- legend_key_chars_equivalence
Integer. Approximate number of characters the legend key equals.
- max_chars_per_figure_width
Integer. Maximum number of characters per figure width.
- multiplier_per_horizontal_line
Numeric. Multiplier per horizontal line.
- multiplier_per_vertical_letter
Numeric. Multiplier per vertical letter.
- multiplier_per_facet
Numeric. Multiplier per facet.
- multiplier_per_legend_line
Numeric. Multiplier per legend line.
- fixed_constant
Numeric. Fixed constant to be added to the height.
- figure_width_in_cm
Numeric. Width of the figure in centimeters.
- margin_in_cm
Numeric. Margin in centimeters.
- max
Numeric. Maximum height.
- min
Numeric. Minimum height.
Examples
fig_height_h_barchart2(makeme(data=ex_survey, dep=b_1:b_3, indep=x1_sex))
#> [1] 2.58