I have an array of data with 3D elements. Ex: x = {{1,2,3}, {3,4,5}, {5,6,7}}
. I want to show this data in 3 dimensions, such that each point in the space is shown as a vector originating from the origin. There should be an arrow/line whose one end is at the origin $(0,0,0)$ and the other end at the point $(1,2,3)$.
Which function should I use?
Answer
For your problem, it is probably easiest to build the graphic out of graphics primitives rather than use a pre-made convenience function such as ListPointPlot3D
.
This is one way to do it:
data = {{1, 2, 3}, {3, 4, 5}, {5, 6, 7}};
Graphics3D[Arrow[{{0, 0, 0}, #}] & /@ data]
I simply used the Arrow
graphics primitive. I constructed a pure function that makes an arrow starting from the origin, and mapped it over the data.
Comments
Post a Comment