# Need VectorPlot to ignore centre of region

I'm trying to plot a vector field over the range $[-1, 1]\times [-1, 1]$, but only outside the circle of radius 0.2 centered at the origin. The function diverges at the origin so the magnitude of all the other arrows is tiny in comparison. I've restricted the plot range using RegionFunction->Function[{x, y, vx, vy, n}, x^2+y^2>0.2], but it doesn't affect the scaling, (I couldn't get it scaling manually either.) A simple example in the style of what I want to do is:

VectorPlot[{1/Sqrt[x^2 + y^2], 1/ Sqrt[x^2 + y^2]}, {x, -1, 1}, {y, -1, 1},
RegionFunction -> Function[{x, y, vx, vy, n}, x^2 + y^2 > 0.2],
VectorScale -> Large]


But with the arrows only scaled based on their values outside the circle of radius 0.2.

Any advice would be much appreciated.

• You can play with options, like there: Plotting a Gravity-Field and in linked topics.
– Kuba
Jan 14, 2016 at 17:55
• A circle of radius 0.2 is defined by x^2 + y^2 > 0.2^2, not x^2 + y^2 > 0.2.
– user484
Jan 15, 2016 at 0:51
• @Rahul, yes, silly typo on my part there when writing out the post. Thanks for pointing it out in case I'd messed that up. Jan 15, 2016 at 12:39

VectorPlot[
If[x^2 + y^2 > .2, {1/Sqrt[x^2 + y^2], 1/Sqrt[x^2 + y^2]}, 0],
{x, -1, 1}, {y, -1, 1},
RegionFunction -> Function[{x, y}, x^2 + y^2 > 0.2],
VectorScale -> Large] or...

VectorPlot[
If[x^2 + y^2 > .2, {1/Sqrt[x^2 + y^2], 1/Sqrt[x^2 + y^2]}, {0, 0}],
{x, -1, 1}, {y, -1, 1},
VectorScale -> Large]

• Just look! A NKPT! (New Kind of Pythagorean Theorem) :) Jan 14, 2016 at 18:14
• Brilliant, didn't think of composing a conditional. Thanks very much. Jan 14, 2016 at 18:26
VectorPlot[{1/Sqrt[x^2 + y^2], 1/Sqrt[x^2 + y^2]},
{x, -1, 1}, {y, -1, 1},
PlotRange -> 1.1,
RegionFunction -> Function[{x, y}, x^2 + y^2 > 0.2],
VectorPoints -> Coarse,
VectorScale -> 0.5] 