0
$\begingroup$

ListPointPlot3D may not be the correct approach to use, it was just the first form I could think of in attempting to solve this

I have data that I want to display in a 3D scatter plot, where the points themselves are different depending on the fourth variable. The data I am using is here, where the first three numbers in each row were the independent variables set by me during the simulations, and the fourth represents the result. As the result depends on all three variables it was hoped that with a 3D scatter plot it would be possible to in some way control the appearance (colour, size, etc) of individual points based on the result (the fourth column).

A few of the examples on Mathematica's site, and elsewhere that I have found, have the appearance determined for all the points in the plot, rather than scope for each point. It would be possible to generate a bunch of different scatter plots and then Show them all in one but with a large number of data points, it seems like an unnecessary long approach.

I am wondering if there is a simpler method that I just haven't seen or known of with the plotting methods in Mathematica.

(If there are anything unclear in my question I am happy to edit to clear up confusion)

$\endgroup$
0
$\begingroup$
data = Import["/Users/roberthanlon/Downloads/data_used.txt"] //
   ToExpression;

{min, max} = MinMax[data[[All, 4]]];

Use whichever scaling and Color Scheme that best highlight what you are looking for in your data.

Graphics3D[{
    ColorData["TemperatureMap"][Rescale[#[[4]], {min, max}]],
    Point[Most[#]]} & /@ data, BoxRatios -> {1, 1, 1}, Axes -> True]

enter image description here

EDIT: Adding a ListContourPlot3D may help in visualizing the data.

Manipulate[
 Show[
  ListContourPlot3D[data, Contours -> Range[60, 100, del], 
   PlotLegends -> Placed[Automatic, Bottom]],
  Graphics3D[{ColorData["TemperatureMap"][Rescale[#[[4]], {min, max}]], 
      Point[Most[#]]} & /@ data, BoxRatios -> {1, 1, 1}, Axes -> True], 
  ImageSize -> Large],
 {{del, 10, "Contour Steps"}, Range[5, 10, 2.5]}]

enter image description here

$\endgroup$
  • $\begingroup$ That seems like a great solution to my query. Thank you very much. $\endgroup$ – Audioworm Dec 7 '17 at 14:58
  • 1
    $\begingroup$ VertexColors could be more efficient when data is large: Graphics3D[ Point[data[[All, ;; 3]], VertexColors -> (ColorData["TemperatureMap"] /@ Rescale[data[[All, 4]], {min, max}])] , BoxRatios -> {1, 1, 1}, Axes -> True] $\endgroup$ – halmir Dec 7 '17 at 15:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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