7

Perhaps this question has been asked before but even though I searched the site I did not find what I want.

The code is rather simple:

data = Import["orbit3d.out", "Table"];
d = Table[{data[[i, 2]], data[[i, 3]], data[[i, 4]]}, {i, 1, Length[data]}];
l = Line[d];
S0 = Graphics3D[{Black, Thickness[0.002], l}];
P0 = Show[{S0}, Axes -> True, 
AxesStyle -> Directive[FontSize -> 20, FontFamily -> "Helvetica"], 
AxesLabel -> {"x", "y", "z"}, BoxRatios -> {1, 1, 1}, 
BoxStyle -> Directive[Dashed], PlotRange -> 5.5, ImageSize -> 550]

which produces the following plot

enter image description here

The complete data file can be obtained here: data file

Now I want to produce the projections of the 3D orbit on the three priamry planes (x,y), (x,z) and (y,z) and plot them on the sides of the bounding box.

Any ideas?

Vaggelis_Z
  • 8,740
  • 6
  • 34
  • 79
  • Hint: P0/.{x_?NumericQ,y_?NumericQ,z_?NumericQ}:>{x,y,0} etc..BTW a self-contained example would be preferable - why should we need to download a file for this? – Yves Klett Aug 27 '15 at 15:33
  • @YvesKlett I evaluated your command but it does not show anything. Can you give some more details? – Vaggelis_Z Aug 27 '15 at 15:44
  • @YvesKlett Now it's working but it does not produce what I want. I want the three projections of the 3D orbit to be shown as shadows on the sides of the bounding box. – Vaggelis_Z Aug 27 '15 at 15:46
  • @Vaggelis, it should be easy to change the 0 in Yves's snippet to something else. In any event, there was an old package function called Shadow[] you might want to search for… – J. M.'s missing motivation Aug 27 '15 at 16:18

1 Answers1

19
data = Import["orbit3d.out", "Table"];

(* Your Table is not needed; you can use [[...]] instead *)
(*d=Table[{data[[i,2]],data[[i,3]],data[[i,4]]},{i,1,Length[data]}];*)
d = data[[All, 2 ;; 4]];

l = Line[d];

(* Projections on bounding box *)
lz = l /. {x_, y_, z_} -> {x, y, -5.5};
ly = l /. {x_, y_, z_} -> {x, 5.5, z};
lx = l /. {x_, y_, z_} -> {-5.5, y, z};

S0 = Graphics3D[{
        Black, Thickness[0.002], l,
        GrayLevel[0.7], lx, ly, lz
       },
       Axes -> True, AxesLabel -> {"x", "y", "z"},
       AxesStyle -> Directive[FontSize -> 20, FontFamily -> "Helvetica"],
       BoxRatios -> {1, 1, 1}, BoxStyle -> Directive[Dashed],
       PlotRange -> 5.5, ImageSize -> 550
     ]

Mathematica graphics

MarcoB
  • 67,153
  • 18
  • 91
  • 189