2
$\begingroup$

I'd like 3Dplot a list of data with 4 columns (these are mesh outputs):

x1 y1 z1 Dose1
x2 y2 z2 Dose2
.
.
.

which command i should to use??

$\endgroup$
3
  • 1
    $\begingroup$ Image3D is a possibility. But I'd advise you to do at least some basic searching through the docs before posting questions. $\endgroup$
    – jVincent
    Sep 19, 2013 at 20:33
  • $\begingroup$ You could try using Graphics3D to place a little sphere at {x1,y1,z1}, with radius determined by Dose1. Or you could place points at {x1,y1,z1} with the color determined by Dose1. $\endgroup$ Sep 19, 2013 at 20:39
  • 1
    $\begingroup$ @TimothyWofford BubbleChart3D is meant for that. Ali, it's really up to you what command you want to use, look here at this list for a starter: reference.wolfram.com/mathematica/guide/… $\endgroup$
    – C. E.
    Sep 19, 2013 at 20:54

3 Answers 3

3
$\begingroup$

Like I said in the comments, BubbleChart3D is meant to do what ListPointPlot3D is doing in this case. For example:

d = RandomReal[{0, 1}, {100, 4}];
BubbleChart3D[d]

bubble1

In this first example, the volume of the bubbles is proportional to the fourth element. To represent the fourth dimension with colors, we can do this:

BubbleChart3D[d, 
  BubbleSizes -> {0.02, 0.02},
  ColorFunction -> (ColorData["TemperatureMap"][#4] &)]

bubble2

$\endgroup$
2
$\begingroup$

Quick & dirty, the color represents the fourth coordinate :

d = RandomReal[{0, 1}, {100, 4}];
Block[{i = 1},
   ListPointPlot3D[d[[All, ;; 3]], 
         ColorFunction -> Function[{x, y, z}, ColorData["TemperatureMap"][d[[i++, 4]]]], 
         PlotStyle -> Directive[PointSize[Large]]]]

Mathematica graphics

$\endgroup$
3
  • $\begingroup$ after importing in mathematica, our data form is:{{x1,y1,z1,dos1},{x2,y2,z2,dos2},...} are you sure i can plot these data with this commands?? $\endgroup$
    – ali
    Sep 19, 2013 at 21:07
  • $\begingroup$ @ali Take a look at his example data using d[[1 ;; 5]] -- it is exactly in this format. $\endgroup$
    – C. E.
    Sep 19, 2013 at 21:13
  • $\begingroup$ Ok, Thanks a lot! $\endgroup$
    – ali
    Sep 19, 2013 at 21:53
1
$\begingroup$

How about a grid of x vs y combinations. Here is an example in R http://gettinggeneticsdone.blogspot.ca/2011/07/ Not difficult to do in Mathematica also, just not automatic.

a = Table[RandomReal[], {x, 1, 3}, {y, 1, 3}];
x = Table[RandomReal[], {x, 1, 3}, {y, 1, 100}];
y = a.x;

Table[ListPlot[Thread[{y[[i]], y[[j]]}], PlotLabel -> {i, j}], {i, 1, 
  3}, {j, 1, 3}] // Grid

enter image description here

$\endgroup$
2
  • $\begingroup$ Ian, RandomReal[] can receive parameters, so it's unnecessary to wrap it with a table. You can make your y in a single line. As for the charts, here's a more elegant example: wolfram.com/mathematica/new-in-9/… $\endgroup$ Sep 20, 2013 at 0:51
  • $\begingroup$ Yes and yes. Good example. My example is obviously just thrown together. $\endgroup$
    – user9444
    Sep 20, 2013 at 1:03

Your Answer

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

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