I have 6 linear limitations. I know how to find a solution to this problem both manually and through r . I am looking for an easy way to get an illustration for a possible region.
I tried ggplot2 to do this without any success.
Here are the limitations: x1 >= 0, x2 >= 0, x2 <= 10 and x2 <= 12 - 2/5 * x1 , x2 <= 18 - x1 , x2 <= 18 - x1
require(ggplot2)
Thank you for your help!
EDIT : removing the last y5 from the pmin function does the trick:
p0 + geom_area(aes(y = pmin(y1,y2,y3,y4,y5)), fill = 'gray60')
source share