2
$\begingroup$

I generated some pics from 2 datum,one in $x$ direction and the other in $y$,so I used the commands:

exfield = Range[200];
polarplane = Range[200];
Get["C:\\Users\\dc\\Desktop\\polarplane.dat"];
Get["C:\\Users\\dc\\Desktop\\exfield.dat"];
xx = Table[
Transpose[{exfield[[25, i]], polarplane[[25, i]]}], {i, 71}];
ListVectorPlot[xx]

to get the vector field. But one problem here is, all the pics generated by the commands share the same maximum length of the vector. I can only see the orientation change but no magnitude change. I need a cartain standard (for instance, 1 cm vector length for the maximum data value $a_{max}$) to generate all the pics, so I can see the relative magnitude change. But I couldn't find the options. Have anyone encountered this same problem? Thank you. And the sample datum are like:

 exfield[[001]] = {              
{
   a11,
   ……,
   a1i,
},
{
   a21,
   ……,
   a2i,
 },
   ……
 {
   ai1,
   ……,
   aii,
  },
 }

and the sample data:

data

$\endgroup$
4
  • $\begingroup$ Could you maybe post polarplane.dat and exfield.dat somewhere (e.g. Pastebin)? $\endgroup$ Commented Nov 12, 2012 at 11:10
  • $\begingroup$ Oh, you finally come! Why not log in? $\endgroup$
    – xzczd
    Commented Nov 13, 2012 at 3:56
  • $\begingroup$ it's quite a large file, tons of datum, I am trying to find a place to upload the file $\endgroup$
    – user49114
    Commented Nov 13, 2012 at 4:04
  • $\begingroup$ dropbox.com/s/m3p34ncas3qd8qm/datum.rar here, and, thank you $\endgroup$
    – user49114
    Commented Nov 13, 2012 at 4:09

1 Answer 1

3
$\begingroup$

You can use the VectorScale option for ListVectorPlot to control the scaling of vector sizes.

ListVectorPlot[Table[{y, -x}, {x, -3, 3, 0.2}, {y, -3, 3, 0.2}], 
 VectorScale -> .05]

Mathematica graphics

ListVectorPlot[Table[{y, -x}, {x, -3, 3, 0.2}, {y, -3, 3, 0.2}], 
 VectorScale -> .1]

Mathematica graphics

Here is a fleshed out version:

Gather some data:

xxs = Table[Transpose[{exfield[[#, i]], polarplane[[#, i]]}], {i, 71}] & /@Range[27,35];

Find the relevant max vector sizes.

scales = With[{s = Max@Apply[Norm@#&,#,{2}] & /@ xxs}, s/Max@s];

Plot the vector fields, with a couple of fiddle factors for arrowhead size and absolute vector length:

GraphicsGrid[
 Partition[
  MapThread[
   ListVectorPlot[#1, VectorScale -> #2, 
     VectorStyle -> Arrowheads[#2 0.015]] &, {xxs, 0.3 scales}], 3]]

Mathematica graphics

$\endgroup$
7
  • $\begingroup$ This is a little different from OP's intention: he wants the length of arrows to somewhat represent the size of the vector. $\endgroup$
    – xzczd
    Commented Nov 13, 2012 at 3:59
  • $\begingroup$ sorry I didn't put it clear, what i mean is i wanna use the same standard to present all the vectors in different plots. thank you anyway $\endgroup$
    – user49114
    Commented Nov 13, 2012 at 4:10
  • $\begingroup$ You can use the VectorScale to adjust the scale to the relative maximum size of the largest vector from each set of data. $\endgroup$ Commented Nov 13, 2012 at 9:38
  • $\begingroup$ Er…we can also use Norm instead of EuclideanDistance, right? $\endgroup$
    – xzczd
    Commented Nov 14, 2012 at 6:05
  • $\begingroup$ @xzczd Yes certainly :) $\endgroup$ Commented Nov 14, 2012 at 7:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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