# trajectory density plot

I want to make a plot that shows the density of trajectories (x-y plots). In other words I want a plot that's analogous to this but with curves instead of points as data.

Here's what I'm doing right now (with a simplified function) which gives okay results for 100 curves but doesn't scale to 10,000:

ta = RandomVariate[NormalDistribution[0, 0.3], {100}];
p = Map[Cos[t - #] &, ta];
Plot[p, {t, 0, 10}, PlotStyle -> {{Black, Opacity[0.05]}}]


I'd also prefer to not have to quantize the x-y space. But if that's the only solution I'll accept it.

• Have you seen DensityPlot, could you use that to display the number of trajectories that pass through the X-Y space? – image_doctor Jun 27 '15 at 0:07
• I have. I'm not sure how i'd compute a density function from 10,000 stochastic trajectories though... – user1816847 Jun 27 '15 at 5:17
• At each of may constant-x surfaces, compute the distribution (in y) of lines that pass through it. Of course, this will require discretizing x-y space. – bbgodfrey Jun 27 '15 at 6:29

fs = Function[{s, t}, (1 + Cos[t - #]) (1 + Sin[s - #])] & /@

DensityPlot[Plus @@ (#[x, y] & /@ fs), {x, 0, 2 π}, {y, 0, 2 π}]