1
$\begingroup$

I have a (long) list of {x,y,z,f} values generated using a finite element software package. I've tried using

ListContourPlot3D[data, PlotRange -> All, Contours -> {0}]

to visualize the data set but what it generates is an empty box ranging from {-1,1} in all directions.

It sounds similar to this problem here: https://stackoverflow.com/questions/2497517/mathematica-listcontourplot3d but the solution provided only works for discrete data generated from a table construct; my data is already discrete.

I can visualize parts of the data using:

ListPlot3D[{#[[1]],#[[2]],#[[4]]}&/@data]

but I lose a critical part of the data when I do that.

I've also tried applying a solution similar to this: Smooth 4D (3D + color) plot from discrete points but I lose the ability to (easily?) control the color function to stay constant between multiple data sets, ie. I do not want the color function to auto range with the current data set, I would like to be able to set the color function range between the maximum and minimum of largest data set as to track the changes over all of the data sets.

I've included a sample section of the data below which gives the general overview of the data but has been truncated from the original data set.

The output image (isn't this) but should look something like this: this

data={{82.1986, 90.1101, -50.5433, -0.023},
{82.1986, 13.8898, -50.5431, -0.023},
{148.544, 13.8945, -17.7456, -0.00807},
{148.543, 90.1056, -17.7443, -0.00803},
{15.8543,  90.1056, -17.7437, -0.00803},
{15.8543, 13.8944, -17.7438, -0.00804},
{82.1986, 85.028, -50.5282, -0.0234},
{82.1986, 79.9457, -50.5423, -0.0232},
{82.1986, 74.8638, -50.5669, -0.023},
{82.1986, 69.7824, -50.5912, -0.0227},
{82.1986, 64.7014, -50.6104, -0.0225},
{82.1986, 59.6207, -50.623, -0.0223},
{82.1986, 54.5402, -50.6291, -0.0223},
{82.1986, 49.4597, -50.6291, -0.0223},
{82.1986, 44.3792, -50.6229, -0.0223},
{82.1986, 39.2985, -50.6103, -0.0225},
{82.1986, 34.2175, -50.5911, -0.0227},
{82.1986, 29.1361, -50.5667, -0.023},
{82.1986, 24.0542, -50.5421, -0.0232},
{82.1986, 18.9719, -50.528, -0.0234},
{87.2701, 13.8899, -50.3669, -0.0229},
{92.3173, 13.8902, -49.8408, -0.0227},
{97.3169, 13.8908, -48.9711, -0.0223},
{102.247, 13.8915, -47.7676, -0.0217},
{107.088, 13.8922, -46.2437, -0.021},
{111.823, 13.893, -44.4156, -0.0201},
{116.438, 13.8937, -42.3021, -0.0191},
{120.922, 13.8943, -39.9237, -0.018},
{125.27, 13.8947, -37.3023, -0.0168},
{129.477, 13.895, -34.4607, -0.0155},
{133.545, 13.895, -31.4219, -0.0142},
{137.476, 13.8949, -28.2086, -0.0127},
{141.28, 13.8947, -24.8436, -0.0112},
{144.965, 13.8945, -21.3488, -0.00958},
{148.521, 18.975, -17.7192, -0.00821},
{148.511, 24.0559, -17.7071, -0.00822},
{148.509, 29.1369, -17.704, -0.00818},
{148.511, 34.2178, -17.7058, -0.00812},
{148.515, 39.2986, -17.7094, -0.00804},
{148.519, 44.3792, -17.7129, -0.00801},
{148.52, 49.4598, -17.7149, -0.00799},
{148.52, 54.5403, -17.7148, -0.00799},
{148.518, 59.6208, -17.7127, -0.00801},
{148.515, 64.7015, -17.7091, -0.00805},
{148.511, 69.7822, -17.7051, -0.0081},
{148.508, 74.8632, -17.7031, -0.00816},
{148.51, 79.9442, -17.7059, -0.00818},
{148.52, 85.0251, -17.7179, -0.00816},
{144.964, 90.1055, -21.3481, -0.00961},
{141.279, 90.1053, -24.8432, -0.0112}}
$\endgroup$
2
  • $\begingroup$ Also, the first row of your data has 4 elements, whereas the rest has three. You should start from there and use the correct command. $\endgroup$
    – RunnyKine
    Sep 22, 2014 at 5:25
  • $\begingroup$ Sorry, I copied the data into Notepad++ to add the 4 spaces for formatting and I messed it up and made it look like it has 3 elements whereas it should have 4 elements throughout. $\endgroup$ Sep 22, 2014 at 21:04

1 Answer 1

1
$\begingroup$

The first and last row of data contain a fourth element. Eliminating this we get

Use a specific contour:

ListContourPlot3D[data,
 Contours -> {0},
 Mesh -> None,
 Lighting -> "Neutral",
 ContourStyle -> Texture[ExampleData[{"ColorTexture", "WhiteMarble"}]]]

enter image description here

Use five equally spaced contours:

ListContourPlot3D[data,
 Contours -> 5,
 ContourStyle -> Opacity[0.5],
 Mesh -> None]

enter image description here

$\endgroup$
2
  • $\begingroup$ Thank you for answering the question, unfortunately the data I copied in was poorly formatted so you answered a question which doesn't help me. Sorry! $\endgroup$ Sep 22, 2014 at 21:05
  • $\begingroup$ @AndrewStewart You are welcome. Things like this happen :) $\endgroup$
    – eldo
    Sep 22, 2014 at 21:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.