user1054158
user1054158

Reputation:

Matplotlib or Sympy - Implicit inequalities or relations

Can matplotlib draw relations like x^2+y^2<=2 in blue and then x^2+y^2<=1+0.5*sin((x^3+y^3)*2pi) in red ?

Upvotes: 3

Views: 497

Answers (1)

wim
wim

Reputation: 362756

You should look at plot_implicit in sympy.

>>> from sympy import plot_implicit, sin, symbols, pi
>>> x, y = symbols('x y')
>>> my_plot = plot_implicit(x**2 + y**2 <= 1 + 0.5 * sin((x**3 + y**3) * 2 * pi))

enter image description here

Upvotes: 4

Related Questions