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)以居中对齐标题。
这个函数还有专门的图形主题函数——forest_theme()函数,用来美化图形。 主要可设置图形部分包括:字体大小、字体簇、置信区间的美化、坐标轴、参考线、脚注等内容。 forest_theme(base_size = 12, base_family = "", ci_pch = 15, ci_col = "black", ci_lty = 1, ci_lwd = 1, ci_Theight = NULL,...
首先,我们需要安装并加载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...
# 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_...
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...
dt_tmp<-rbind(dt[-1,],dt[1,])dt_tmp[nrow(dt_tmp),1]<-"Overall"# Define theme 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 li...
(%.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$...
(%.2f to %.2f)",dt$est,dt$low,dt$hi))#Define themetm<-forest_theme(base_size=10,refline_col="red",arrow_type="closed",footnote_gp=gpar(col="blue",cex=0.6))p<-forest(dt[,c(1:3,20:21)],est=dt$est,lower=dt$low,upper=dt$hi,sizes=dt$se,ci_column=4,ref_line=1,arrow_...
Summary fill will inherit the summary color in the forest_theme function. Better vignettes. Fix an issue in with ticks digits in forest. forestploter 0.2.3 Fixed a bug of legend point estimation color not changing. There's a new function add_border to add border to any cell at any side...
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), ...