# Plotting Uncertainty for a Sample of Functions

I am trying to produce a plot showing the variation in a sample of functions. It should look like this plot or that plot. I tried to use SmoothDensityHistogram. Even for the following simple example this does not look right. Do you have other suggestions?

My approach so far was:

dx = 0.01;
functionSample =
Table[noise = Random[NormalDistribution[0, 0.5]];
Table[ {x, x (1 - x) + noise}, {x, 0, 1, dx}], {i, 1, 60}];
var = Flatten[diff, 1];
ListPlot[functionSample[[All, All]], Joined -> True]
SmoothDensityHistogram[var,
ColorFunction -> (Blend[{White, Black}, #] &)]


Producing

Maybe things can be improved by choosing a small bandwidth of the kernel in x direction and a larger in y direction of the underlying kernel smoother.

Just for visualisation purposes you can use Filling:

dx = 0.01;
n = 10;
functionSample = Table[noise = Random[NormalDistribution[0, 0.5]];
Table[{x, x (1 - x) + noise}, {x, 0, 1, dx}]
, {i, 1, n}];

ListPlot[Evaluate[{Mean[{##}], ##} & @@ functionSample],
Joined -> True, Filling -> (# -> {1} & /@ Range[2, n + 1]),
PlotStyle -> {Directive[[email protected], Orange], Sequence @@ Array[Thin &, n]},
FillingStyle -> Directive[[email protected], Gray]]


PlotStyle -> {Directive[[email protected], Orange], Sequence @@ Array[None &, n]},
FillingStyle -> Directive[[email protected], Gray]