Search code examples
pythonplotsympycartesian-coordinates

How to plot a cartesian equation with SymPy?


How to plot a cartesian equation with SymPy? For example how to plot

x*(x+y) + 2*x^3 + x^4 + y^4 == 0

Solution

  • Use sympy.plotting.plot_implicit.plot_implicit:

    from sympy import *
    x, y = symbols("x, y")
    plot_implicit(x * (x + y) + 2 * x**3 + x**4 + y**4)
    

    plot