Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Plot linear equations/inequalities in Julia

Tags:

julia

Suppose we have couple of linear inequalities like 2x-5y<=6 and x+y>=0, how do we plot the two inequalities? To extend this, if we have multiple such inequalities how do we try to solve this graphically?

like image 409
Abhijith Avatar asked Dec 25 '22 01:12

Abhijith


1 Answers

You can try ImplicitEquations:

using ImplicitEquations, Plots
f(x,y) = 2x - 5y - 6
g(x,y) = x + y - 0
plot((f < 0) & (g > 0))

Resulting in the region over the default rectangle [-5,5], [-5,5]:

rendered image

like image 133
jverzani Avatar answered Jan 02 '23 02:01

jverzani