I am effectively trying to modify this solution from José Antonio Díaz Navas Drawing a vertical line at the mean of a bell curve so that the lines, rather than red, match the colour of the line - but I can't get the syntax correct.
Plot[
MapThread[Function[{μ, σ}, PDF[NormalDistribution[μ, σ], x]], {{1, 2, 3, 4,5}, {0.5, 1.0, 1.5, 2.0, 2.5}}] // Evaluate, {x, -10, 10},
Filling -> Axis,PlotLegends -> LineLegend[{"Five Years", "Three Years", "One Year", "Six Months",
"Three Months"}],
PlotStyle -> {Thickness[.001], Thickness[.002], Thickness[.003],
Thickness[.004], Thickness[.005]}, PlotRange -> {{0, 10}, All},
Epilog -> ({Red, Dashing[0.01],
Line@MapThread[{{#1, 0}, {#1, #2}} &,
{
{1, 2, 3, 4, 5},
Evaluate@(MapThread[Function[{μ, σ},
PDF[NormalDistribution[μ, σ], μ]], {{1, 2,3, 4, 5}, {0.5, 1.0, 1.5, 2.0, 2.5}}])
}
]
})
]
I know that ColorData[1,n]
will give me the colour of the nth line, but I cannot figure out how to use this to set the lines colours. I tried simply replacing Red with a list of colours but this didn't work.