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.

This question already has an answer here:

I have a data file with six columns {x,y,z} and {ux,uy,uz} respectively, and I would like to plot the 3D vector field. http://www.mediafire.com/download/udoa61hu0m6itrc/campo.txt

I'm trying to do this,

te = Import["C:\\Users\\oliver\\Documents\\campo.txt", 
            "Table", "IgnoreEmptyLines" -> True];
x = te[[All, 1]];
y = te[[All, 2]];
z = te[[All, 3]];
ux = te[[All, 4]];
vy = te[[All, 5]];
wz = te[[All, 6]];
point = Transpose[{x, y, z}];
vel = Transpose[{ux, vy, wz}];

ListVectorPlot3D[Transpose[{point, vel}], PlotRange -> Full,VectorPoints -> All] 

The vector field must be as this picture, http://www.mediafire.com/download/9ddgux4ralx712k/1.jpg enter image description here

share|improve this question

marked as duplicate by Michael E2, m_goldberg, Sjoerd C. de Vries, Artes, rm -rf Jul 13 '13 at 15:32

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
Try this and tell me why I do not see similarity: X = te[[;; 180, ;; 3]]; V = te[[;; 180, 4 ;; 6]]; Graphics3D[{Arrowheads@0.01, Arrow@Transpose[{X, X + V}], Red, Point@X}] –  Kuba Jul 12 '13 at 19:02
    
I'm not sure, but it looks like the option VectorPoints -> All doesn't behave as described in the documentation of ListVectorPlot3D (2nd bullet of the Details and Options section). –  Sjoerd C. de Vries Jul 12 '13 at 20:59
    
@SjoerdC.deVries did You get any plot with ListVectorPlot3D with whatever options? I've failed to create any with {{X,V}...} data type. –  Kuba Jul 12 '13 at 21:05
    
@Kuba, I did that you said me and i get a plot with one disc, but the picture that i put , is of a set of disks, basically are circumferences displaced in z. –  Oli Jul 12 '13 at 21:16
1  

1 Answer 1

te = Import["campo.txt", "Table", "IgnoreEmptyLines" -> True];
X = te[[;; , ;; 3]];
V = te[[;; , 4 ;; 6]];

Graphics3D[{Arrowheads@.005, Arrow@Transpose[{X, X + .1 Normalize /@ V}]}, 
           BoxRatios -> {2, 2, 7}, PlotRange -> All, ViewPoint -> {1.5, 1.5, 0},  
           ViewVertical -> {0, 1, 0}, Boxed -> False]

enter image description here

On Your image there are couple of vectors thicker than the rest. Creating plot with variable thickness of arrows will result with heavy model so lets extract only the lognest and add them.

Histogram[Norm /@ (V)] (*I've checked this to set threshold to `1.7`*)
pos = Position[V, x_ /; Norm@x > 1.7, 1];

Graphics3D[{
            Arrowheads@.005, Arrow@Transpose[{X, X + .1 Normalize /@ V}][[ ;; ]],
            Red, Arrowheads@.02, Thick, 
            Arrow@Transpose[Extract[#, pos] & /@ {X, X + .3 Normalize /@ V}]  
            }, 
            BoxRatios -> {2, 2, 7}, PlotRange -> All, ImageSize -> 1200, 
            ViewPoint -> {0.444, 2.073, -0.036}, Boxed -> False,
            ViewVertical -> {-1.900, 2.937, -0.021}]

enter image description here

share|improve this answer
    
+1 Although not with ListVectorPlot... –  Sjoerd C. de Vries Jul 12 '13 at 22:24
    
I did this solution, but i get this error, Arrow argument should be a list of coordinates, What is happening?. –  Oli Jul 12 '13 at 22:27
    
@Oli is te what it should be? Try reset the kernel and reimport the data. –  Kuba Jul 12 '13 at 22:36
    
I did, but not working, i get the same error. –  Oli Jul 12 '13 at 22:56
    
@Oli Import["campo.txt".. in Your case is different. Are You importing from right place. What error exactly are You getting? –  Kuba Jul 12 '13 at 22:59

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