Message Boards Message Boards

Plot with VectorPlot over a region

GROUPS:

Hello.

First time here for me.

I want to plot the vector field A, enter image description here over the region enter image description here

I tried the following:

VectorPlot[{y, -x}, {x, y} \[Element] (1/4 < x^2 + y^2 && x^2 + y^2 < 9)]

But it doesn't work, although

RegionPlot[1/4 < x^2 + y^2 && x^2 + y^2 < 9, {x, -4, 4}, {y, -4, 4}]

does return the correct region.

Can someone give me any kind of help with it? Or explain where is the syntax error?

POSTED BY: Udi Behar
Answer
1 month ago

It works if you add ImplicitRegion:

VectorPlot[{y, -x}, {x, y} \[Element] 
  ImplicitRegion[(1/4 < x^2 + y^2 && x^2 + y^2 < 9), {x, y}]]
POSTED BY: Gianluca Gorni
Answer
1 month ago

Works. Great.

POSTED BY: Udi Behar
Answer
1 month ago

You can also use Annulus:

VectorPlot[{y, -x}, {x, y} \[Element] Annulus[{0, 0}, {1/2, 3}]]
POSTED BY: Gianluca Gorni
Answer
1 month ago

Group Abstract Group Abstract