# PlotRegion and colors

I have to plot about 24 different predicates using RegionPlot

RegionPlot[{set1,set2,......,set24},{x,-Range,Range},{y,-Range,Range},PlotLegends->"AllExpressions",BoundaryStyle->Dashed]


where set1 through set24 are each unions of some fixed number of inequalities in $$x$$ and $$y$$.

How do I get Mathematica to choose 24 distinct colors or shading/filling for these 24 predicates, without having to assign them manually?

EDIT: How do you get the legend of the different regions to be labeled inside the regions? Previous answers on SE for similar queries focused on using coordinates, but I would like to do this automatically.

• A mimimal example (minimal in the sense that you don't need to give us the full 24 predicates) would be helpful here, so that we can run the code that you give us in order to help. In addition, it would help us to determine what you need. I suspect that you need non-overlapping regions colored separately, but without the code and explanation, it's hard to figure out what you need. – march Dec 20 '18 at 19:53

The colors are automatically distinct:

    RegionPlot[
Evaluate@
Table[RandomReal[] x > (-1)^i RandomReal[] y + 5 RandomReal[],
{i, 24}],
{x, -5, 5}, {y, -5, 5}
]


Try also:

PlotStyle -> Table[{Opacity[0.5], Hue[i/24]}, {i, 24}]

• thanks! But how do you get well-distinguishable colors, or even better, each region shaded differently so that if there are two regions with the same color, then they can be distinguished in some way? [Also: I edited my question slightly. Please have a look.] – leastaction Dec 21 '18 at 18:33