I am running an experiment where I fit two models a few hundred times. I want to plot the results of all of these runs. Each color represents a different model and each line a single run.
I am using ggplot2
and the geom_line()
function, and tried to make it such that the single lines fade away and overlapping ones become stronger so that a “main line” comes up. Playing around with the alpha
settings didn’t help. I guess because most lines actually don’t really overlap. How could I improve this?
modelB_color <- rgb(0, 0, 0, alpha = alpha_value)
modelA_color <- rgb(1, 0, 0, alpha = alpha_value)
for (data in simulation_data) {
modelA <- data$modelA
modelB <- data$modelB
x <- seq(0, 1, length = 100)
g <- g + geom_line(data = modelB, aes(x = x, y = y_probs, color = "modelA"), linewidth = 0.5)
g <- g + geom_line(data = modelA, aes(x = x, y = y, color = "modelA"), linewidth = 0.5)
}
g <- g + scale_color_manual(
name = "Model",
values = c("modelB" = modelB_color, "modelA" = modelA_color),
labels = c("modelB", "modelA")
)
5