0
$\begingroup$

I am trying to visualize a 3D magnetic structure which is given by the following list of vectors:

daje={{{{{{0., 0., 0.5}, {0, 0, 1}}, {{0., 0., 1.5}, {0, 0, 1}}}, {{{0., 
  1., 0.5}, {0, 0, 1}}, {{0., 1., 1.5}, {0, 0, 1}}}}, {{{{1., 0., 
  0.5}, {0, 0, 1}}, {{1., 0., 1.5}, {0, 0, 1}}}, {{{1., 1., 
  0.5}, {0, 0, 1}}, {{1., 1., 1.5}, {0, 0, 1}}}}}, {{{{{0.5, 
  0.5, -0.5}, {0, 0, -1}}, {{0.5, 0.5, 0.5}, {0, 0, -1}}}, {{{0.5,
   1.5, -0.5}, {0, 0, -1}}, {{0.5, 1.5, 0.5}, {0, 
  0, -1}}}}, {{{{1.5, 0.5, -0.5}, {0, 0, -1}}, {{1.5, 0.5, 
  0.5}, {0, 0, -1}}}, {{{1.5, 1.5, -0.5}, {0, 0, -1}}, {{1.5, 1.5,
   0.5}, {0, 0, -1}}}}}}     

I choose a selected grid of points over which to draw the vectors:

maglia = {{0.`, 0.`, 0.5`}, {0.5, 0.5, -0.5}, {1, 0.`, 0.5`}, {1.5, 0.5, -0.5}}        

I use the command:

ListVectorPlot3D[daje, VectorPoints -> maglia, VectorColorFunction -> "Rainbow", VectorScale -> {Large, 0.5, Automatic}, PlotLegends -> Automatic, PlotRange -> All]        
   

but the output is wrong: in each point it shows two magnetic vectors (see picture), one up and one down. What's wrong with my procedure?

enter image description here

$\endgroup$
7
  • $\begingroup$ It doesn't help. $\endgroup$
    – user84609
    Jan 13 at 15:49
  • $\begingroup$ daje has the dimensions: {2, 2, 2, 2, 2, 3}. However, it should be {n,n,n,3} with a positive integer n. $\endgroup$ Jan 13 at 15:58
  • $\begingroup$ Daniel, if I try flatten[daje,2] I get dimensions {8, 2, 2, 3} but then when I try to plot I get a blanck output. $\endgroup$
    – user84609
    Jan 13 at 16:06
  • $\begingroup$ The dimension along any axis must be at least 3. $\endgroup$ Jan 13 at 16:15
  • $\begingroup$ Can you explain what the data is supposed to be? What are the triples, and how do they relate to one another? Why are they grouped the way they are? $\endgroup$
    – N.J.Evans
    Jan 13 at 18:48

Your Answer

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

Browse other questions tagged or ask your own question.