# 3D visualization of 4D object data

I have some paired data here {{x1,y1},...{x_n,y_n}} (Download link) which represents {frequency, amplitude} of a spatial object surface mesh. Its quite a lot of cells and data as you can see in the histogramms, x frequency, y amplitude, z number of cells with specific frequency and data bin range.

Now this data gets plotted with to visualize distinct spots of the sample surface with different amplitude by different colors. Most of the frequency dynamics happens between 0.3-4.9

ArrayPlot[gridmatrixpair, Mesh -> False, ColorFunction -> (Which[
0.3 < #[[1]] < 4.9 && 1*10^1 > #[[2]] > 1*10^0, Pink,
0.3 < #[[1]] < 4.9 && 1*10^2 > #[[2]] > 1*10^1, Gray,
...
AspectRatio -> 2/7]


or different frequency in narrow amplitude range

ArrayPlot[gridmatrixpair, Mesh -> False, ColorFunction -> (Which[
0.3 < #[[1]] < 0.8 && 1*10^9 > #[[2]] > 1*10^7, Pink,
0.8 < #[[1]] < 1.3 && 1*10^9 > #[[2]] > 1*10^7, Gray,
...
True, White] &), ColorFunctionScaling -> False,
AspectRatio -> 2/7]


I was wondering what would be a solution to show a combined spatial frequency and amplitude distribution in one picture. What I think of is something like the 3rd picture but this 2D picture is actually in a 3DHistogram like picture where the bar height represents the amplitude and bar color frequency, so actually 3D visualization of 4D data. Or represent frequency from lightblue to darkblue, amplitude from lightred to darkred and then both colors are mixed according to RGB to represent the mixture by green, but probably not so good visual contrast as this data covers 4-5 ranges that need to be covererd. One could also probably use simply the 3rd picture and project it on the xy-plane of a ListPlot3D (I think MM can do this), and then take the amplitude as z-data.

I have no starting point and no big overview about MM, I'm looking more for a tip what is the right direction which gives a good visual contrast for those 4-5 ranges.

• It would be helpful to have access to the data. If you can't give the actual data maybe you could give some code to generate representative data. Commented May 23, 2013 at 1:42
• @AndyRoss Thanks, forgot it Commented May 23, 2013 at 9:01
• @JamesLast, can you please give the command that takes in the data as you are using it in your ArrayPlot? At the moment I'm trying: gridmatrixpair=Flatten[ToExpression[Partition[StringReplace[#[[ ;; ]], {"}" -> "", "{" -> "", "," -> ""}],2]]&/@Import["/Directory/gridmatrixpair.dat","Table"],1] and it doesn't seem to be quite what you are looking for. If you can show us how the data should be formatted, that would be very useful. Commented May 28, 2013 at 4:29
• @JonathanShock sorry, I overlooked that when reimporting gridmatrixpair.dat via Import, there is a additional commma between the {x,,y} elements of the array. Seems to come from import, opending the .dat file with editor shows correct {x,y}. How to I avoid this? Flatten and Partition should not be necessary, I already did this so arrayplot can read the data correctly. Commented May 28, 2013 at 12:14