Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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]
ColorFunction -> (Blend[{White, Black}, #] &)]



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

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

Your Answer


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.