3
$\begingroup$
ContourPlot[{x^2+y^2==1, x^2+y^2==4, x^2+y^2==9},{x,-4,4},{y,-4,4},


ContourStyle->{Red,Blue,Green}]
$\endgroup$

2 Answers 2

4
$\begingroup$

ContourShading is the option to shade regions between contours.

ContourPlot[x^2 + y^2, {x, -4, 4}, {y, -4, 4}, 
 Contours -> {1, 4, 9}, ContourShading -> {Red, Blue, Green, None}]

enter image description here

$\endgroup$
8
  • $\begingroup$ Thank you so much. $\endgroup$ Commented Feb 19, 2020 at 6:05
  • $\begingroup$ The problem is solved. Could you please edit or remove the plot(for copyright issues)? It would be highly appreciated if you do so. Please. $\endgroup$ Commented May 14, 2020 at 17:43
  • 3
    $\begingroup$ @Saha, what does copyright have to do with the plot? Have you already seen the licensing terms for using Stack Exchange? $\endgroup$ Commented May 14, 2020 at 18:05
  • 2
    $\begingroup$ @Saha, then you misunderstand the terms of use of Stack Exchange. Please read this again. You can always use images from this site as long as there is attribution/citation, but no one is obligated to remove their work just because you asked. $\endgroup$ Commented May 16, 2020 at 5:30
  • 1
    $\begingroup$ @SahabubJahedi unless I am mistaken, if you make this yourself, for publication, for example, likely you would 1. Improve the appearance of the frame and labels and 2. Be creating your own file, so neither the image previously seen here nor the one in the other answer would be infringed upon. $\endgroup$ Commented May 17, 2020 at 8:11
2
$\begingroup$

You can use RegionPlot:

RegionPlot[{x^2+y^2<=9,x^2+y^2<4,x^2+y^2<=1},{x,-4,4},{y,-4,4},PlotStyle->{Red,Blue,Green}]

enter image description here

I also reversed the order of your expressions, so the smaller ones would show on top of larger ones.

$\endgroup$
1
  • $\begingroup$ Thank you so much. $\endgroup$ Commented Feb 19, 2020 at 6:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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