# Colored plot with Wolfram Mathematica

I saw this image thus I guess that it is possible to color some regions in a plot. What kind of command can I use to have a similar plot?

• Please provide Mathematica code that would generate this plot and look up the Filling command. There are plenty of posts on this site that discuss it.
– Syed
Commented May 8, 2023 at 10:36
• Thanks for your reply but I do not have the code. If you know a similar post please share it. Commented May 13, 2023 at 18:33

The option Filling can color the space between plotted lines (see documentation). In your case, where lines do not intersect, it is easier to stack the plots inside a Show command and fill all the way to the bottom axis and stack the plots in such order that the filling color of the next plot is on top of the last one:

Show[
Plot[2 Sqrt[x] + x, {x, 0, 200}, Frame -> True, Filling -> Top,
FillingStyle -> RGBColor[0.92, 0.9, 0.], PlotRange -> {0, 200},
LabelStyle -> 14],
Plot[1.05 (x - 10) + 10, {x, 40, 200}, Filling -> Axis,
PlotRange -> {0, 200}],
Plot[0.7 (x - 10) + 20
, {x, 40, 200}, Filling -> Axis, FillingStyle -> White,
PlotRange -> {0, 200} ],
Plot[2 Sqrt[x - 10] + 0.5 (x - 10), {x, 10, 200}, Frame -> True,
PlotRange -> {0, 200}, LabelStyle -> 14]
]


which produces

Keep adding lines from top to bottom, so the Filling color of each new line goes on top of the previous line.