首先,我们需要安装并加载forestplot包,然后设置相应的主题forest_theme,最后绘制森林图。 # 安装并加载forestplot包install.packages("forestplot")library(forestplot)# 设置forest_theme主题forest_theme()# 绘制森林图forestplot() 1. 2. 3. 4. 5. 6. 7. 8. 9. 每一步具体操作 安装并加载forestplot包 install...
这个函数还有专门的图形主题函数——forest_theme()函数,用来美化图形。 主要可设置图形部分包括:字体大小、字体簇、置信区间的美化、坐标轴、参考线、脚注等内容。 forest_theme(base_size = 12, base_family = "", ci_pch = 15, ci_col = "black", ci_lty = 1, ci_lwd = 1, ci_Theight = NULL,...
但是可以通过在forest_theme中设置参数来使森林图中的任何单元格对齐。设置core=list(fg_params=list(hjust=0, x=0))以左对齐内容,设置rowhead=list(fg_params=list(hjust=0.5, x=0.5)以居中对齐标题。设置hjust=1和x=0.9以右对齐文本。您还可以通过使用edit_plot更改文本的对齐方式,请参阅另一个vignette中的...
theme = tm) # Print plot plot(pt) 1.3.文本对齐和背景的主题化 默认情况下,所有单元格都是左对齐的。但是可以通过在forest_theme中设置参数来使森林图中的任何单元格对齐。设置core=list(fg_params=list(hjust=0, x=0))以左对齐内容,设置rowhead=list(fg_params=list(hjust=0.5, x=0.5)以居中对齐标题。
# Define theme tm <- forest_theme(base_size = 10, refline_col = "red", footnote_col = "#636363", footnote_fontface = "italic") p <- forest(dt[,c(1:3, 8:9)], est = dt$est, lower = dt$low, upper = dt$hi, sizes = dt$se, ci_column = 4, #指定图绘制在第几列 ref_...
tm<-forest_theme(base_size=10,# Confidence interval point shape,line type/color/width ci_pch=16,ci_col="#762a83",ci_lty=1,ci_lwd=1.5,ci_Theight=0.2,# Set anTend at the endofCI# Reference line width/type/color refline_lwd=1,refline_lty="dashed",refline_col="grey20",# Vertical...
(%.2f to %.2f)", dt$est, dt$low, dt$hi)) # 定义简单的主题 tm <- forest_theme(base_size = 10, refline_col = "red", arrow_type = "closed", footnote_col = "blue") p <- forest(dt[,c(1:3, 20:21)], est = dt$est, lower = dt$low, upper = dt$hi, sizes = dt$...
# Add a blank column for the second CI column dt$` ` <- paste(rep(" ", 20), collapse = " ") # Set-up theme tm <- forest_theme(base_size = 10, refline_col = "red", footnote_gp = gpar(col = "blue"), legend_name = "GP", legend_value = c("Trt 1", "Trt 2")) p...
tm <-forest_theme(core =list(bg_params=list(fill =c("white"))), summary_col = "black", arrow_label_just = "end", arrow_type = "closed") p <-forest(dt_fig, est = dt$est, lower = dt$lb, upper = dt$ub, sizes =sqrt(dt$weights/100), ...
data. Please feel free to changeanything you want.",theme = tm)# Print plotplot(pt) 1.3.文本对齐和背景的主题化 默认情况下,所有单元格都是左对齐的。但是可以通过在forest_theme中设置参数来使森林图中的任何单元格对齐。设置core=list(fg_params=list(hjust=0, x=0))以左对齐内容,设置rowhead=list...