Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

How do I plot something like $$\{(x,y): 1 \leq x^2 + y^2 < 9\}?$$

I want to be able to make the boundary $x^2 + y^2 = 9$ dotted line and the unit circle filled and coloured region in between? I tried using

RegionPlot[1 <= x^2 + y^2 < 9, {x, -3.5, 3.5}, {y, -3.5, 3.5}, 
  Frame -> False, AxesOrigin -> {0, 0}, Axes -> True]

But that gave me a bolded boundary on $x^2 + y^2 = 9$

share|improve this question

1 Answer 1

up vote 6 down vote accepted

All you're missing is the option for BoundaryStyle

RegionPlot[1 <= x^2 + y^2 < 9, {x, -3.5, 3.5}, {y, -3.5, 3.5}, 
 Frame -> False, AxesOrigin -> {0, 0}, Axes -> True, 
 BoundaryStyle -> {Dotted, Thickness[0.005]}]

enter image description here

If you want the unit circle filled, you can RegionPlot that separately:

Show[RegionPlot[1 <= x^2 + y^2 < 9, {x, -3.5, 3.5}, {y, -3.5, 3.5}, 
  Frame -> False, AxesOrigin -> {0, 0}, Axes -> True, 
  BoundaryStyle -> {Dotted, Thickness[0.005]}], 
 RegionPlot[x^2 + y^2 < 1, {x, -3.5, 3.5}, {y, -3.5, 3.5}, 
  PlotStyle -> Red, BoundaryStyle -> {Dotted, Thickness[0.005]}]]

You can find all these (and more) in the help for RegionPlot.

share|improve this answer
    
Your second code gives me a red filled unit circle. –  jip Jan 24 at 2:40
    
Nvm I got it fixed. thanks –  jip Jan 24 at 2:47
    
You did say "and the unit circle filled" so I filled the unit circle with Red... or not... –  bill s Jan 24 at 3:26
    
No that would be the unit disk. –  jip Jan 25 at 2:22

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.