Skip to content

Usage of "nudge_y" #77

@stastowl

Description

@stastowl

I have found nudge_y very helpful in spacing my (grouped) CIs. Is it possible to apply it in a way so it does not affect the summary diamonds?

Right now, I get the following and while I like the spacing of the CIs, I would like to have the diamonds closer together. Any advice on this would be greatly appreciated!

Image

Here's my code:
tm <- forest_theme(base_size = 12,
core = list(bg_params=list(fill = c("#f0f0f0","white")),
fg_params=list(hjust=1, x=0.9)),
# Graphical parameters of confidence intervals
ci_pch = 15,
ci_col = c("#2e2585","#5da899","#337538"),
ci_fill = c("#2e2585","#5da899","#337538"),
ci_alpha = 1,
ci_lty = 1,
ci_lwd = 1,
ci_Theight = 0.1,
# Graphical parameters of reference line
refline_gp = gpar(lwd=1, lty="dashed",col="black"),
# Graphical parameters of diamond shaped summary CI
summary_fill = c("#2e2585","#5da899","#337538"),
summary_col = c("#2e2585","#5da899","#337538"),
#legend
legend_value = c("A","B","C"),
legend_name = "",
legend_position = "right",
arrow_label_just = "end",
#aligning cis
colhead = list(fg_params=list(hjust=0.5, x=0.5))
)

pt3 <- forest(dfplot[,c(2,3,18,4,1)],
est = list(dfplot$Aest, dfplot$Best,dfplot$Cest),
lower = list(dfplot$Acill, dfplot$Bcill, dfplot$Ccill),
upper = list(dfplot$Aciul, dfplot$Bciul, dfplot$Cciul),
sizes = list(dfplot$Asize, dfplot$Bsize, dfplot$Csize),
is_summary = c(rep(FALSE, nrow(dfplot)-1),TRUE),
ci_column = 4,
ref_line = 0,
arrow_lab = c("Favors A", "Favors B"),
xlim = c(-1.2, 1.2),
ticks_at = c(-1, -0.75, -0.5, -0.25, 0, 0.25, 0.5, 0.75, 1),
xlab = "EST",
theme = tm,
nudge_y = 0.2)
pt3$heights<-rep(unit(25,"mm"),nrow(pt3)-1)

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions