Creates a forestploter theme with parameters that control overall plot sizing and appearance. This is the primary way to control how large the forest plot renders.
create_forest_theme(
base_size = 10,
scale = 1,
row_padding = NULL,
ci_pch = 15,
ci_lwd = NULL,
ci_Theight = NULL,
ci_col = "black",
header_fontsize = NULL,
body_fontsize = NULL,
footnote_fontsize = NULL,
footnote_col = "darkcyan",
title_fontsize = NULL,
cv_fontsize = NULL,
cv_col = "gray30",
refline_lwd = NULL,
refline_lty = "dashed",
refline_col = "gray30",
vertline_lwd = NULL,
vertline_lty = "dashed",
vertline_col = "gray20",
arrow_type = "closed",
arrow_col = "black",
summary_fill = "black",
summary_col = "black"
)A list of class "fs_forest_theme" containing all theme parameters.
Numeric. Base font size in points. This is the primary scaling parameter - increasing it will proportionally scale all fonts, row padding, and line widths. Default: 10.
Numeric. Additional scaling multiplier applied on top of base_size. Use for quick overall scaling. Default: 1.0.
Numeric vector of length 2. Padding around row content in mm as c(vertical, horizontal). If NULL, auto-calculated from base_size. Default: NULL.
Integer. Point character for CI. 15=square, 16=circle, 18=diamond. Default: 15.
Numeric. Line width for CI lines. If NULL, auto-calculated from base_size. Default: NULL.
Numeric. Height of T-bar ends on CI. If NULL, auto-calculated from base_size. Default: NULL.
Character. Color for CI lines and points. Default: "black".
Numeric. Font size for column headers. If NULL, auto-calculated as base_size * scale + 1. Default: NULL.
Numeric. Font size for body text. If NULL, auto-calculated as base_size * scale. Default: NULL.
Numeric. Font size for footnotes. If NULL, auto-calculated as base_size * scale - 1. Default: NULL.
Character. Color for footnote text. Default: "darkcyan".
Numeric. Font size for title. If NULL, auto-calculated as base_size * scale + 4. Default: NULL.
Numeric. Font size for CV annotation text. If NULL, auto-calculated as base_size * scale. Default: NULL.
Character. Color for CV annotation text. Default: "gray30".
Numeric. Reference line width. If NULL, auto-calculated. Default: NULL.
Character. Reference line type. Default: "dashed".
Character. Reference line color. Default: "gray30".
Numeric. Vertical line width. If NULL, auto-calculated. Default: NULL.
Character. Vertical line type. Default: "dashed".
Character. Vertical line color. Default: "gray20".
Character. Arrow type: "open" or "closed". Default: "closed".
Character. Arrow color. Default: "black".
Character. Fill color for summary diamonds. Default: "black".
Character. Border color for summary diamonds. Default: "black".
The base_size parameter is the primary way to control plot size.
When you change base_size, the following are automatically scaled:
All font sizes (body, header, footnote, CV, title)
Row padding (vertical and horizontal)
CI line width and T-bar height
Reference and vertical line widths
The scaling formula uses base_size = 10 as the reference point:
base_size = 10: Default sizing
base_size = 12: 20% larger
base_size = 14: 40% larger
base_size = 16: 60% larger
You can override any individual parameter by specifying it explicitly.
The theme does NOT set row background colors - those are determined
automatically by plot_subgroup_results_forestplot() based on
row types (ITT, reference, posthoc, etc.).
plot_subgroup_results_forestplot, render_forestplot
# \donttest{
# Simple: just increase base_size for larger plot
large_theme <- create_forest_theme(base_size = 14)
print(large_theme)
# Or use scale for quick adjustment
large_theme <- create_forest_theme(base_size = 10, scale = 1.4)
# Fine-tune specific elements
custom_theme <- create_forest_theme(
base_size = 14,
cv_fontsize = 12,
ci_lwd = 2.5
)
# }
Run the code above in your browser using DataLab