Message Boards Message Boards

Plot with VectorPlot over a region

Posted 6 years ago

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: Ehud Behar
3 Replies

You can also use Annulus:

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

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
Posted 6 years ago

Works. Great.

POSTED BY: Ehud Behar
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract