## Code

```
# Load necessary libraries
library(ggplot2)
library(grid)
g <- rasterGrob(c("lightgreen", "yellow", "orange", "red"),
width=unit(1,"npc"), height = unit(1,"npc"),
interpolate = TRUE)
# Create a continuous range for the y-axis
y_values <- seq(0.01, 1000, length.out = 10000)
# Create data frame for plotting
data <- data.frame(
BayesFactor = y_values
)
# Define a continuous color gradient from a deeper yellow to green to blue
color_gradient <- c("#FFD700", "#00B300", "#0000FF")
# Plot the data
ggplot(data, aes(y = BayesFactor, fill = BayesFactor)) +
geom_tile(aes(x = 0.5), width = 0.2) + # Greatly reduce the x-direction plot area
scale_y_continuous(trans = "log10",
breaks = c(0.01, 1/3, 1, 3, 10, 30, 100, 1000),
labels = c("0", "1/3", "1", "3", "10", "30", "100", "∞"),
expand = c(0, 0)) +
#scale_fill_gradientn(colors = color_gradient, name = NULL) +
geom_segment(aes(x = 0.4, xend = 0.6, y = 1/3, yend = 1/3), linetype = "dashed", color = "black") +
geom_segment(aes(x = 0.4, xend = 0.6, y = 3, yend = 3), linetype = "dashed", color = "black") +
geom_segment(aes(x = 0.4, xend = 0.6, y = 10, yend = 10), linetype = "dashed", color = "black") +
geom_segment(aes(x = 0.4, xend = 0.6, y = 30, yend = 30), linetype = "dashed", color = "black") +
annotate("text", x = 0.5, y = sqrt(0.01 * 1/3), label = "Evidence against\ntreatment effect", size = 4.5, hjust = 0.5, vjust = 0.5) +
annotate("text", x = 0.5, y = 2, label = "Not enough data to\nknow if the drug works", size = 4.5, hjust = 0.5, vjust = 0.5) +
annotate("text", x = 0.5, y = 20, label = "Evidence for\ntreatment effect", size = 4.5, hjust = 0.5, vjust = 0.5) +
annotate("text", x = 0.65, y = sqrt(30 * 500), label = "{very strong pro-alternative}", hjust = 0, size = 4.5) +
annotate("text", x = 0.65, y = sqrt(10 * 30), label = "{strong pro-alternative}", hjust = 0, size = 4.5) +
annotate("text", x = 0.65, y = sqrt(3 * 10), label = "{moderate pro-alternative}", hjust = 0, size = 4.5) +
annotate("text", x = 0.65, y = sqrt(1/3 * 3), label = "{ambiguous}", hjust = 0, size = 4.5) +
annotate("text", x = 0.65, y = sqrt(0.01 * 1/3), label = "{pro-null}", hjust = 0, size = 4.5) +
coord_cartesian(xlim = c(0.4, 1), ylim = c(0.01, 1000), clip = "off") + # Limit x-axis and ensure no clipping of text
theme_minimal() +
theme(
axis.title.x = element_blank(),
axis.title.y = element_text(size = 12),
axis.text.y = element_text(size = 12),
axis.text.x = element_blank(),
axis.ticks = element_blank(),
panel.grid = element_blank(),
legend.position = "none",
plot.margin = unit(c(0.5, 0.5, 0.5, 0.5), "cm") # Reduced overall plot area
) +
labs(y = "Bayes Factor") +
annotation_custom(g, xmin=0.4, xmax=0.6, ymin=-2, ymax=Inf) +
ggtitle("Bayes factors and evidential strength")
ggsave("output/BF.pdf", dpi = 600, device = "pdf")
ggsave("output/BF.png", dpi = 600, device = "png")
```