Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

How to visualize a set of vectors with 3 coordinates $(x,y,z)$, e.g.,$(1,1,1), (1,-1,-1),(-1,1,-1),(-1,-1,1)$? In fact there are many of them.

I try the function "Graphic3D" with the following code

Graphics3D[{Arrow[{{0, 0, 0}, {1, 1, 1}}], Arrow[{{0, 0, 0}, {1, -1, -1}}]}, 
{Arrow[{{0, 0, 0}, {-1, 1, -1}}], Arrow[{{0, 0, 0}, {1, -1, -1}}]},
Axes -> True, Boxed -> True]

However, it seems it can only give me the first two vectors in the plot. How can I visualize all of them at the same time? And is there any other way to visualize them?

enter image description here

share|improve this question

closed as off-topic by xzczd, m_goldberg, Simon Woods, Sjoerd C. de Vries, RunnyKine May 26 at 14:30

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – xzczd, m_goldberg, Simon Woods, Sjoerd C. de Vries, RunnyKine
If this question can be reworded to fit the rules in the help center, please edit the question.

    
You need to put all your Arrows in one pair of braces i.e. something like Graphics3D[{Orange, {Arrow[{{0, 0, 0}, {1, 1, 1}}]}, Red, Arrow[{{0, 0, 0}, {1, -1, -2}}], Green, Arrow[{{0, 0, 0}, {-1, 1, -1}}], Blue, Arrow[{{0, 0, 0}, {1, -1, -1}}]}, Axes -> True, Boxed -> True, PlotRange -> All]. –  xzczd May 26 at 10:22

1 Answer 1

The first argument of Graphics3D is a list of all primitives to be drawn. If you look carefully, you'll notice that your first argument is a list of the first two vectors and your second argument a list of the third and fourth vectors. Your brackets aren't nested correctly.

After correcting the error:

Graphics3D[{Arrow[{{0, 0, 0}, {1, 1, 1}}], 
Arrow[{{0, 0, 0}, {1, -1, -1}}], Arrow[{{0, 0, 0}, {-1, 1, -1}}], 
Arrow[{{0, 0, 0}, {-1, -1, 1}}]}, Axes -> True, Boxed -> True]

, the function outputs what you would expect:

Four Vectors

share|improve this answer

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