I have a fairly complicated scalar analytical function of 3 variables that appears to be quite incompatible with SliceContourPlot3D
(I shut it down after a few minutes without results). What is the correct way to visualize it in 3D space using not 3D data array as suggested by ListSliceContourPlot3D
, but rather precalculated data on 2D planes which I'm trying to visualize? In other words, I'm trying to do ListContourPlot
in few different planes and arrange results in 3D space accordingly.
Also there is another problem when ListContourPlot3D
gives empty box:
A dump file with NNSolution array that creates empty ListSliceContourPlot3D[NNSolution, "CenterPlanes"]
.
Example:
Structured tables look alright:
data = Table[Sqrt[x^2 + y^2 + z^2], {z, 0, 3, 0.1}, {y, 0, 3, 0.1}, {x, 0, 3, 0.1}];
ListSliceContourPlot3D[data, "CentralPlanes"]
But unstructured data is pretty bad:
data1 = Flatten[
Table[
{x, y, z, Sqrt[x^2 + y^2 + z^2]},
{z, 0, 3, 0.1}, {y, 0, 3, 0.1}, {x, 0, 3, 0.1}
],
1];
ListSliceContourPlot3D[data1, "CentralPlanes"]
In two-dimensional case they are indistinguishable:
data1 = Flatten[Table[{z, y, Sqrt[y^2 + z^2]}, {z, 0, 3, 0.1}, {y, 0, 3, 0.1}], 1];
ListContourPlot[data1]
data = Table[Sqrt[y^2 + z^2], {z, 0, 3, 0.1}, {y, 0, 3, 0.1}];
ListContourPlot[data]
This is a rationale for using 2D contours and aligning them in 3D instead of 3D slice plot.
This is my silly version:
data1 = Flatten[Table[{x, y, Sqrt[(y + 1/2)^2 + (x - 1/2)^2]}, {x, -2, 2, 0.1}, {y, -2, 2, 0.1}], 1];
data2 = Flatten[Table[{y, z, Sqrt[(0 - 1/2)^2 + (y + 1/2)^2 + z^2]}, {y, -2, 2, 0.1}, {z, -2, 2, 0.1}], 1];
data3 = Flatten[Table[{x, z, Sqrt[(x - 1/2)^2 + (0 - 1/2)^2 + z^2]}, {x, -2, 2, 0.1}, {z, -2, 2, 0.1}], 1];
aa1 = Image[
ListContourPlot[data1, Frame -> False, ColorFunctionScaling -> False, Contours -> {0.15, 0.5, 1, 1.5, 2, 2.5}], ImageSize -> 200];
aa2 = Image[ListContourPlot[data2, Frame -> False, ColorFunctionScaling -> False, Contours -> {0.15, 0.5, 1, 1.5, 2, 2.5}], ImageSize -> 200];
aa3 = Image[ListContourPlot[data3, Frame -> False, ColorFunctionScaling -> False, Contours -> {0.15, 0.5, 1, 1.5, 2, 2.5}], ImageSize -> 200];
ParametricPlot3D[{{x, y, 0}, {0, x, y}, {x, 0, y}}, {x, -1, 1}, {y, -1, 1},
PlotStyle -> {Texture[aa1], Texture[aa2], Texture[aa3]}, Mesh -> False]
Note that textures look blurry and the whole thing is quite slow.
ListSliceContourPlot3D
is broken, please post your attempt - most likely it can be fixed without having to reimplement a built-in function $\endgroup$ – Lukas Lang May 29 '18 at 21:26SliceContourPlot
. The fact that it didn't immediately work out of the box may not necessarily mean that it's impossible to make it work. Without specifics of your actual case, we cannot do much more than guess. $\endgroup$ – MarcoB May 30 '18 at 18:07Flatten
to level 2 rather than level 1: that is,data2 = Flatten[Table[{x, y, z, Sqrt[x^2 + y^2 + z^2]}, {z, -2, 2, .1}, {y, -2, 2, .1}, {x, -2, 2, .1}], 2]; ListSliceContourPlot3D[data2, "CenterPlanes"]
? $\endgroup$ – kglr May 30 '18 at 21:36