I'm writing a processor in Mathematica to get some analytics on some data I've collected via a hadoop MapReduce process.
It's a list of records in the form
<float>, tc:<int>, m:<int>, h:<int>; <float>
I do some messy processing and extract a list of tuples in the form {<int>, <int>, <float>}
(which corresponds to x, y, z) which I want to plot using ListPlot3D
.
data = (* <processed data in form of list of {<c:<int>,m:<int>,h:<int>,<float>}> *)
plotPoints =
Table[
{N[Part[StringSplit[Part[x, 1], ":"], 2]],
N[Part[StringSplit[Part[x, 1], ":"], 2]],
N[Part[x, 4]]},
{x, data}]
ListPointPlot3D[plotPoints, PlotRange -> All, DataRange -> All]
In my output, the list plotPoints
looks correct, but plotting it creates an empty plot, and using ListPointPlot3D
gives the error
Last {} has zero length and no last element.
This is what the output from plotPoints
and ListPlot3D
looks like
Edit
For better debugging here is the full script:
data =
Join[
Part[
Part[
Select[#, compare], 1] & /@
StringSplit[Take[StringSplit[#, ";"], 1], "\t"],
1] & /@ #,
Take[Part[StringSplit[#, ";"], 3], {2}]] &
/@
Import["nh-r-00000"]
plotPoints =
Table[
{N[Part[StringSplit[Part[x, 1], ":"], 2]],
N[Part[StringSplit[Part[x, 1], ":"], 2]],
N[Part[x, 4]]},
{x, data}]
ListPlot3D[plotPoints, PlotRange -> All]
Dataset: http://sta.sh/02dfd34p35pp