Message Boards Message Boards


Plot with VectorPlot over a region

Posted 2 months ago
3 Replies
2 Total Likes


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?

3 Replies

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 2 months ago

Works. Great.

You can also use Annulus:

VectorPlot[{y, -x}, {x, y} \[Element] Annulus[{0, 0}, {1/2, 3}]]
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract