0
$\begingroup$

I am trying to put color gradient on my data, or want values above some number to appear red and green below that number. For my situation the number is 5.14*10^(-13). I have X, Y, and Z axis data, respectively in the in the link. I tried using vectorcolorfunction and colordata and couldn't make it work.
This is my code

data = Import["DATA - Sheet1.csv"];
ve = Partition[data, 5];
vecdata = Partition[ve, 7]; 
v = ListVectorPlot3D[vecdata, DataRange -> {{-15, 15}, {-15, 15}, {20, 30}}, 
  VectorPoints -> 5, VectorScale -> {0.1, Scaled[0.5]}]

Link to my data

My data produces this image

This is how my data looks without color variation

Any help will be appreciated and thanks in advance

$\endgroup$
3
$\begingroup$

You did not specify which value x, y, or z you wish to consider, or some combination thereof. Nevertheless this may help:

data = Import["DATA - Sheet1.csv"];
ve = Partition[data, 5];
vecdata = Partition[ve, 7]; 

ListVectorPlot3D[vecdata,
  DataRange -> {{-15, 15}, {-15, 15}, {20, 30}},
  VectorPoints -> 5,
  VectorScale -> {0.1, Scaled[0.5]}, 
  VectorColorFunction -> 
   Function[{x, y, z}, If[Min[x, y, z] > 5.14*10^(-13), Red, Green]]
]

enter image description here

$\endgroup$
  • $\begingroup$ Thanks a lot, I really appreciate it $\endgroup$ – Makhjoom Ferdous Jun 20 '16 at 12:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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