# Contourplot, how to make a circular area?

I am trying to illustrate this math problem with a graph.

I tried several things, amongst other:

ContourPlot[{4 <= x^2 + y^2 <= 25}, {x, 0, Infinity}, {y, 0,
Infinity}]


How should I write it?

Thank you very much.

• ContourPlot is used to plot level curves. Is that what you want? Your code indicates that you want to plot a continuous range of level curves. – C. E. Jul 5 '18 at 9:26
• RegionPlot is for plotting inequalities. – Lotus Jul 5 '18 at 10:00
• @C.E. I don't get the thing with level curves. I have two variables. – Dovendyr Jul 5 '18 at 10:30

Is this what you want ?

RegionPlot[{4 <= x^2 + y^2 <= 25}, {x, -10, 10}, {y, -10, 10}] • Yes @Lotus, this is what I want. I added Axes -> True. How can I make it more beautiful? – Dovendyr Jul 5 '18 at 10:29
• RegionPlot has many many options to make it look beautiful. Check it out ! – Lotus Jul 5 '18 at 10:31
• Hahaha look, it got out of control really fast! RegionPlot[{4 <= x^2 + y^2 <= 25}, {x, -7, 7}, {y, -7, 7}, Axes -> True, ColorFunction -> "DarkRainbow", PlotLegends -> "Expressions", Mesh -> 30, MeshShading -> {{Red, Yellow}, {Pink, Orange}}] – Dovendyr Jul 5 '18 at 10:33

If you want to use ContourPlot this might be another option:

ContourPlot[Boole[4 <= x^2 + y^2 <= 25], {x, -8, 8}, {y, -8, 8}]


which gives You can use Annulus:

Region @ Annulus[{2, 5}] Here, I just use Region to visualize the annulus. If you want the portion of the annulus in the first quadrant:

Region @ Annulus[{0, 0}, {2, 5}, {0, Pi/2}] The nice thing about this approach is that the annulus is computable. For example, using this representation one can solve the integral in the linked question:

Integrate[x^3 y^2 Log[x^2+y^2], {x,y} ∈ Annulus[{0,0},{2,5},{0,Pi/2}]]


-(4/735) (77997 + 896 Log - 546875 Log)

While RegionPlot is the easiest approach, you could also use ContourPlot

ContourPlot[x^2 + y^2, {x, -6, 6}, {y, -6, 6},
Contours -> {4, 25}, 