Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- data = Import["http://mi.eng.cam.ac.uk/~mh521/js/data.js", "Text"];
- x = Select[ToExpression /@ (StringSplit[data, ","][[8 ;; -2]]),
- NumberQ];
- ps = Transpose[{Range[Length[x]], x}];
- Needs["ComputationalGeometry`"];
- poly = DelaunayTriangulation[ps];
- Graphics[{
- GraphicsComplex[ps,
- Table[
- With[{p = poly[[j]],
- col = ColorData["StarryNightColors"][(*j/Length[poly]*)
- RandomReal[]]},
- {
- Opacity[
- Mod[RandomVariate[NormalDistribution[j/Length@poly, 0.1]],
- 1]],
- Darker@col,
- If[j < Length[poly], Line[{First[p], poly[[j + 1, 1]]}], {}],
- col,
- Table[
- Polygon[{First[p], p[[-1, i]],
- p[[-1, Mod[i + 1, Length@Last[p], 1]]]}]
- , {i, Length@Last[p]}]}
- ]
- ,
- {j, Length@poly}]
- ]
- }, PlotRange -> All, AspectRatio -> 0.618]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement