Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I want to plot the overlapping regions of several inequalities. For example,

RegionPlot[{x + y > 0, x - y > 0, x^2 + y^2 < 1, x y < 1}, {x, -2, 2}, {y, -2, 2}]

The regions for the inequalities can overlap twice, three times, and so on. I want to make a plot in grayscale, such that the more times they overlap, the darker the region is. Is there a way to do that?

share|improve this question
    
Possible duplicate How to find regions that satisfy this inequality?. –  Artes Dec 8 '13 at 21:03
    
related: overlapping polygons –  Kuba Dec 8 '13 at 21:41

2 Answers 2

up vote 8 down vote accepted

One way:

Show[RegionPlot[#, {x, -2, 2}, {y, -2, 2}, 
     PlotStyle -> Opacity[.3]] & /@ {x + y > 0, x - y > 0,  x^2 + y^2 < 1, x y < 1}]

Mathematica graphics

share|improve this answer

Or with one plot:

RegionPlot[{x + y > 0, x - y > 0, x^2 + y^2 < 1, x y < 1}, {x, -2, 2}, {y, -2, 2}, 
 PlotStyle -> ConstantArray[Directive[Opacity@.3, Black], 4], 
 BoundaryStyle -> Thick]

enter image description here

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.