I'm considering mapping an error estimate matrix onto the surface of a function f(x,y) in the indicated range:
theF[x_, y_] = -1.295 + y (-0.1098 - 0.43 Log[x]) - 2.36 Log[x]
Plot3D[theF[x, y], {x, 0.056, 0.83}, {y, 50, 508}, PlotRange -> All,
BoxRatios -> {1, 1, 1}]
For a matrix of points in the plot range, there is an error matrix assigning to each point, a corresponding non-negative error code:
errorTable = {{8, 7, 6, 5, 4, 4, 3, 3, 3, 2, 2, 1, 2, 1, 1, 1, 0, 0,
0, 0, 0, 0, 0, 0, 0}, {8, 7, 6, 5, 4, 4, 4, 3, 2, 2, 2, 2, 1, 1,
1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0}, {7, 6, 5, 5, 4, 3, 3, 3, 2, 2,
2, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {6, 5, 5, 4, 4, 3,
3, 2, 2, 2, 1, 2, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0}, {7, 6,
5, 4, 4, 4, 3, 3, 3, 2, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1}, {7, 6, 5, 4, 4, 4, 4, 3, 2, 2, 3, 2, 2, 2, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1}, {7, 6, 5, 4, 4, 4, 3, 3, 3, 3, 2, 3, 2, 2, 2, 2,
2, 1, 1, 1, 1, 1, 1, 1, 1}, {7, 5, 5, 4, 4, 3, 3, 3, 3, 3, 2, 2,
2, 2, 2, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1}, {5, 4, 4, 4, 3, 4, 3, 3,
3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2}, {6, 5, 5, 5,
4, 4, 4, 3, 4, 3, 3, 3, 3, 2, 3, 3, 3, 2, 3, 2, 2, 2, 2, 2, 2}};
The dimension of errorTable is {10,25} and as an example, can just use a random matrix:
errorTable = Table[RandomInteger[{0, 8}], {10}, {25}]
For example, in the matrix above errorTable[[1,1]]=8 and that corresponds to the error for the point (x,y)=(0.056,50) and so forth. I know how to create an ArrayPlot
and color the error codes and then map this plot as a texture to the surface of f:
theF[x_, y_] = -1.295 + y (-0.1098 - 0.43 Log[x]) - 2.36 Log[x]
ap = ArrayPlot[errorTable,
ColorRules -> {-1 -> Red, 0 -> Black, 1 -> Blue, 2 -> Green,
3 -> Yellow, 4 -> Purple, 5 -> Orange, 6 -> White, 7 -> Magenta,
8 -> Pink}];
cPlot = Plot3D[
theF[x, y], {x, Abs[aVals[[1]]], Last@Abs[aVals]}, {y, 50,
seriesSize}, Mesh -> False, PlotStyle -> {Texture[ap]},
TextureCoordinateFunction -> ({#1, #2} &), BoxRatios -> {1, 1, 1},
PlotRange -> All]
And I could add a legend but it's not quickly comprehensible and confussing-looking. Is there a way to map the error matrix numbers directly onto F in a clear and easy to read way and if so could someone help me do this?