# Plot a the equation of a line with shading below

Is it possible to obtain something similar to what I show below with Mathematica? • Yes. Where are you stuck? – Kuba Jan 31 '17 at 13:27
• Basically, I started with RegionPlot and I continue with Plot[-(2/3) x + 6, {x, -5, 15}, Filling -> Axis]. But I cannot find how to better manipulate the filling option, let alone how to create this "randomly" looking region. – Dimitris Jan 31 '17 at 13:32

I would use the RegionPlot and add some additional condition on the region you want to show. For example:

Show[
RegionPlot[
2 x + 3 y < 6 &&
Sqrt[0.9 (x - 1.2)^2 + (y - 1)^2] < 3 + 0.2 Sin[6 ArcTan[x - 1, y - 1]],
{x, -3, 5}, {y, -3, 5},

Axes -> True,
AxesOrigin -> {0, 0},
Frame -> False,
AxesLabel -> {x, y},
PlotRange -> {{-2, 4}, {-2, 4}},
PlotRangeClipping -> False,
PlotPoints -> 40,
BoundaryStyle -> None],

Plot[y /. Solve[2 x + 3 y == 6, y], {x, -1.45, 3.85}],
Graphics[Rotate[Text[2 x + 3 y == 6, {1.3, 1.4}], -35 Degree]]
] Of course choosing the clipping region may be the biggest challenge. Here I used equation for a circle, and added some wiggles with sine.

• Thank you very much! Exactly what I wanted. – Dimitris Jan 31 '17 at 17:00

If you are willing to accept a shaded half-plane in place of an irregular region, it is relatively easy.

Module[{pts},
pts = {x, y} /. FindInstance[2 x + 3 y == 6, {x, y}, Reals, 2];
Graphics[
{{GrayLevel[.8], HalfPlane[pts, {+1, -1}]},
InfiniteLine[pts],
Rotate[
Inset[
Style[TraditionalForm[2 x + 3 y == 6], 14],
.5 ({0, 2} + {3, 0}) + .2 {1, 1}],
ArcTan[-2/3]]},
PlotRange -> {{-4, 5}, {-3, 5}},
Axes -> True]] ### Update

Plot and Filling and be used to do this, too. You simply have to use a different set of options.

Plot[2 - 2 x/3, {x, -4, 5},
AspectRatio -> Automatic,
PlotRange -> {Automatic, {-3, 5}},
Filling -> Bottom,
Epilog ->
{Rotate[
Inset[
Style[TraditionalForm[2 x + 3 y == 6], 14],
.5 ({0, 2} + {3, 0}) + .2 {1, 1}],
ArcTan[-2/3]]}] • Thanks a lot for your workaround. But just from curiosity: Why Filling does not support something similar? – Dimitris Jan 31 '17 at 17:02
• @dimitris You can use the PlotRange to properly pan the region in the RegionPlot: RegionPlot[2 x + 3 y < 6, {x, -3, 5}, {y, -3, 5}, PlotRange -> {{-2, 4}, {-2, 4}}, Frame -> False, Axes -> True, AxesLabel -> {x, y}, Epilog -> Inset[Rotate[2 x + 3 y < 6, -35 Degree], {1.3, 1.4}] ] – mszynisz Jan 31 '17 at 17:15
• Perfect. Why you don't post it as a reply? – Dimitris Jan 31 '17 at 17:25
• @dimitris. Filling does not support something similar; see my update. – m_goldberg Jan 31 '17 at 17:30
• @m_goldberg: Thanks for the update. All the workarounds are very useful. – Dimitris Jan 31 '17 at 21:59