Home > Commands -> 2d Commands -> implicit_plot

EXAMPLES ON MY SAGE PAGE: Implicit Functions - 2d and 3d Plots

 An implicit function is a function that is not solved explicitly for one of its variables. A circle is an example of a 2d implicit function: $x^2+y^2=9$. In sage, you must use DOUBLE EQUALS == to define an implicit function! See below (ex.2) how to define an object as an implicit function. See also: Implicit Functions Basic Syntax: implicit_plot(implicit function with double equals, (x,xmin, xmax),(y,ymin,ymax), options for 1d object, options for 2d plot)

Define and plot a 2d implicit function

Example 1 - circle $x^2+y^2=9$ and 2D plot

var ('x y')
implicit_plot(x^2+y^2==4, (x,-2,2), (y,-2,2), figsize=4, axes="true" )

Example 2 - $e^x=y^2$ and 2D plot (the blanks in the definition of the object imp are for clarity, but the code should work with or without them).

var ('x y')
imp= exp(x)==y^2
implicit_plot(imp, (x,-2,2), (y,-3,3), linestyle="--", figsize=4, axes="true", aspect_ratio=1)

 Example 1 Example 2
Keywords: plot, implicit, functions, 2d