2
$\begingroup$

I want to plot a vector field in which vectors are unite vectors(I want to show just direction of the vectors). I used vector Plot as below:

u = (x (y^2/(x^2 + y^2))/(x^2 + y^2)^(1/2));
v =  (y (y^2/(x^2 + y^2))/(x^2 + y^2)^(1/2));
VectorPlot[Boole[x^2 + y^2 > 1.5] {u, v}, {x, -5, 5}, {y, -5, 5}]

but it considers the size of vectors. Does anyone know how to solve the problem?

$\endgroup$
  • $\begingroup$ Look up VectorScale. $\endgroup$ – J. M. is away Aug 4 '17 at 9:56
1
$\begingroup$
u = beta (x (-1 + 3 y^2/(x^2 + y^2))/(x^2 + y^2)^(3/2)) /. beta -> 1;
v = (y (-1 + 3 y^2/(x^2 + y^2))/(x^2 + y^2)^(3/2));

VectorPlot[Boole[x^2 + y^2 > 1.5] {u, v}, {x, -5, 5}, {y, -5, 5},
 VectorScale -> {Automatic, Automatic, None},
 ImageSize -> Large]

enter image description here

Different sizes, "but not too much"

VectorPlot[Boole[x^2 + y^2 > 1.5] {u, v}, {x, -5, 5}, {y, -5, 5},
 VectorScale -> {Large, Automatic, Exp[#5] &},
 VectorStyle -> Arrowheads[0.02],
 ImageSize -> Large]

enter image description here

$\endgroup$
  • $\begingroup$ is there any way to use different sizes for vectors but the difference is not too much? $\endgroup$ – OLIVER range Aug 4 '17 at 10:12
  • $\begingroup$ please edit your answer because I have edited the question. So I can chose it as correct $\endgroup$ – OLIVER range Aug 4 '17 at 10:26
  • $\begingroup$ which parameter controls "too much"? $\endgroup$ – OLIVER range Aug 4 '17 at 10:49
  • $\begingroup$ Exp[#5]&] - but there are endless possibilities with VectorScale $\endgroup$ – eldo Aug 4 '17 at 11:01
  • $\begingroup$ to make the difference more clear, should i increase 5? $\endgroup$ – OLIVER range Aug 4 '17 at 11:08

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.