# How to make RegionPlot for lists of points

Suppose I have the following function:

DC[x_, y_] := 3 x - y
sigma[x_, y_, z_, d_] := 3 DC[x, y] + 5 z + d


I made list of sigma[x, y, 3, 3] versus x with a condition on DC[x,y] by:

T = Table[{x, If[-50 < DC[x, y] < 50, sigma[x, y, 2, 3]]},
{x, -5, -2,1},{y,2, 6, 1}];


Then

ListPlot[T] gives:

The problem, I don't want a graph like the previous one, alternatively, I 'd like to make a graph like:

with the area between lines shaded,i.e., I'd like to plot the region between the maximum and minimum scatter points of the function ..

Like for instance this plot:

I think I should use from beginning some command rather than ListPlot, like RegionPlot ?

• I suppose adding Filling->{1->{2}} can make this graphics better in style? @ss – Wjx Jun 8 '16 at 10:27
• In your latter case, Filling->Axis will do the job – Wjx Jun 8 '16 at 10:46
• FillingForm can change the properties of your Filling – Wjx Jun 8 '16 at 10:47

lines = Sort[#, #1[[2]] < #[[2]] &][[{1, -1}]] & /@ T;
top = lines[[All, 1]];
bot = lines[[All, 2]];
Show[ListPlot[T],
ListLinePlot[{top, bot}, Filling -> {1 -> {2}}]]


Or you can use ConvexHullMesh to get the region where all the points are.

Show[ConvexHullMesh[Flatten[T, 1]], ListPlot[T],
AspectRatio -> 0.75, Frame -> True]


For Mathematica 7

Needs["ComputationalGeometry"]
T1 = Flatten[T, 1];
ListPlot[T1, Prolog -> {Opacity[0.3], Blue, Polygon[T1[[#]] & /@ ConvexHull[T1]]}]

• Actually from the beginning can I use some command instead of ListPlot, because I don't want these points. Rather I want to make "shaded" region – S.S. Jun 8 '16 at 10:13
• use Filling. I modified my answer. – Sumit Jun 8 '16 at 10:35
• I'm also modified my question, please look at .. – S.S. Jun 8 '16 at 10:38
• You can not use RegionPlot` here, because it is not a single function you are plotting. You have multiple parameter value and each will describe one condition. So you will end up with combining 5 different regions. – Sumit Jun 8 '16 at 10:49
• So can I just make a smooth curve a round the scatter points, like the attached blue plot .. – S.S. Jun 8 '16 at 10:59