# How to color a curve

How does one color the interior of the elongated circular region in the following figure:

ContourPlot[y^2 - x (x - 1)(x - 3) == 0, {x, -2, 7}, {y, -4, 3}]


Try without "==0"

ContourPlot[y^2 - x (x - 1) (x - 3), {x, -2, 7}, {y, -4, 3}]


• But I need only the curve not the surface Mar 24, 2019 at 20:47

c = ContourPlot[y^2 - x (x - 1) (x - 3) == 0, {x, -2, 7}, {y, -4, 3}]


The region you would like colored

R = RegionPlot[y^2 - x (x - 1) (x - 3) < 0 && x < 2, {x, -2, 7}, {y, -4, 3}]


Both plotted together

Show[c, R]


• Thank you so so much sir. That's what I need. Mar 24, 2019 at 20:50
• @Sara, You are welcome!
– mjw
Mar 24, 2019 at 20:52
• @Sarayaqob you mistakenly accepted my answer Mar 24, 2019 at 21:05
• That's okay. Anyway, your answer works. One question is whether or not we can color in the round area only using ContourPlot[].
– mjw
Mar 26, 2019 at 17:11
• You can color the RegionPlotwith PlotStyle, e.g. R = RegionPlot[ y^2 - x (x - 1) (x - 3) < 0 && x < 2, {x, -2, 7}, {y, -4, 3}, PlotStyle -> Yellow]
– rmw
Apr 4, 2019 at 17:08