Advertisement
Matthen

Line under a line etc.

Jun 23rd, 2011
706
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. Clear[ycoords];
  2. ycoords[0] = Accumulate[RandomReal[NormalDistribution[0, 0.1], 100]];
  3. ycoords[n_] :=
  4. ycoords[n] =
  5. ycoords[n - 1] + RandomReal[NormalDistribution[0, 0.05], 100];
  6. Clear[xcoords];
  7. xcoords[0] = Accumulate[RandomReal[NormalDistribution[1, 0.1], 100]];
  8. xcoords[n_] :=
  9. xcoords[n] =
  10. Sort[xcoords[n - 1] +
  11. RandomReal[NormalDistribution[0.08, 0.05], 100]];
  12. k = 100; ListPlot[
  13. Table[Partition[
  14. Riffle[MovingAverage[xcoords[i], 2],
  15. MovingAverage[ycoords[i], 2] - i], 2], {i, 0, k}], Axes -> None,
  16. Joined -> True, InterpolationOrder -> 2, PlotRange -> {2, -102},
  17. PlotStyle -> Black, ImageSize -> {500}]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement