# Cannot shade 3D vector in different color

I need to color each vector into different colors... but this formula just doesn't work:

m = Axes3D;
n = ListPointPlot3D[{{4, 5, 6}, {3, -3, -6}, {2, 2, 5}},
PlotLegends -> Automatic, ImageSize -> 400,
PlotStyle -> PointSize[0.03], PlotRange -> {-10, 10}];
o = Graphics3D[Arrow[{{4, 5, 6}, {3, -3, -6}}], Axes -> True,
Boxed -> False, ColorOutput -> Red](*vector a*);
r = Graphics3D[Arrow[{{4, 5, 6}, {2, 2, 5}}], Axes -> True,
Boxed -> False, ColorOutput -> Blue](*vector b*);
s = Graphics3D[Arrow[{{2, 2, 5}, {3, -3, -6}}], Axes -> True,
Boxed -> False, ColorOutput -> Black](*vector a-b*);
Show[m, n, o, r, s]

• Did you check the documentation for ColorOutput? It says that ColorOutput is only used in version 5 and below, what version of Mathematica are you using? Have you checked the documentation for Graphics3D? Can you find any examples that color objects? – C. E. Jan 23 '15 at 7:48
• The Mathematica version is indeed needed. Why are you using Axes3D? What is it? – Öskå Jan 23 '15 at 15:21

## 1 Answer

You haven't defined Axes3D[]. Nevertheless:

n = ListPointPlot3D[{{4, 5, 6}, {3, -3, -6}, {2, 2, 5}},
PlotLegends -> Automatic, ImageSize -> 400,
PlotStyle -> PointSize[0.03], PlotRange -> {-10, 10}];
o = Graphics3D[{Red, Arrow[{{4, 5, 6}, {3, -3, -6}}]}, Axes -> True,
Boxed -> False];
r = Graphics3D[{Blue, Arrow[{{4, 5, 6}, {2, 2, 5}}]}, Axes -> True,
Boxed -> False];
s = Graphics3D[{Black, Arrow[{{2, 2, 5}, {3, -3, -6}}]}, Axes -> True,
Boxed -> False];
Show[n, o, r, s] Or... more simply:

Graphics3D[{
{PointSize[0.03], Point[{{4, 5, 6}, {3, -3, -6}, {2, 2, 5}}]},
{Red, Arrow[{{4, 5, 6}, {3, -3, -6}}]},
{Blue, Arrow[{{4, 5, 6}, {2, 2, 5}}]},
{Black, Arrow[{{2, 2, 5}, {3, -3, -6}}]}},
Axes -> True,
PlotRange -> {{-10, 10}, {-10, 10}, {-10, 10}}] Or tighter code, with internal axes:

Graphics3D[{
{PointSize[0.03], Point[{{4, 5, 6}, {3, -3, -6}, {2, 2, 5}}]},
MapThread[{#1, Arrow[#2]} &,
{{Red, Blue, Black},
{{{4, 5, 6}, {3, -3, -6}}, {{4, 5, 6}, {2, 2, 5}}, {{2, 2, 5}, {3, -3, -6}}}}]},
Axes -> True,
AxesOrigin -> {0, 0, 0},
PlotRange -> {{-10, 10}, {-10, 10}, {-10, 10}}]