Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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

ListPlotSmoothDensityHistogram

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.

share|improve this question
add comment

1 Answer

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[Thickness@.02, Orange], Sequence @@ Array[Thin &, n]}, 
         FillingStyle -> Directive[Opacity@.3, Gray]]

enter image description here

PlotStyle -> {Directive[Thickness@.02, Orange], Sequence @@ Array[None &, n]}, 
FillingStyle -> Directive[Opacity@.1, Gray]

enter code here

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.