two-dimensional implicit plotting - Maple Help

Home : Support : Online Help : Graphics : Packages : plots : plots/implicitplot

plots[implicitplot] - two-dimensional implicit plotting

 Calling Sequence implicitplot(expr, x=a..b, y=c(x)..d(x), options) implicitplot(ineq, x=a..b, y=c(x)..d(x), options) implicitplot(f, a..b, c..d, options) implicitplot([expr1,expr2,t], x=a..b, y=c(x)..d(x), options)

Parameters

 expr - expression or equation depending on x and y ineq - inequality depending on x and y f - equation containing procedures or operators representing a function of 2 variables expr1,expr2 - equations or expressions in x, y and t, polynomial in t x,y,t - variables a,b,c,d - real constants c(x),d(x) - expressions that evaluate to real constants for a fixed x value options - (optional) as described in the Options section, or any plot options; see plot/options

Description

 • The implicitplot command computes the two-dimensional plot of an implicitly defined curve.  By default, the curve is computed in Cartesian coordinates.
 • In the first calling sequence, implicitplot(expr, x=a..b, y=c(x)..d(x)), the equation expr must have components that are expressions in the names x and y. The expr parameter can also be an expression instead of an equation, in which case the equation expr = 0 is plotted. The range a..b must evaluate to real constants, and the range c(x)..d(x) must evaluate to real constants for any fixed value of x.
 • In the second calling sequence, implicitplot(ineq, x=a..b, y=c(x)..d(x)), the inequality can depend only upon x and y. If the inequality is strict, the border of the inequality is plotted as a dotted line, while for nonstrict it is plotted as a solid line. There is also a difference in the behavior of the filledregions option (described in the Options section).
 • In the third calling sequence, implicitplot(f, a..b, c..d), the assumption is made that the equation f consists only of procedures or operators taking no more than two arguments. The f parameter can also be a procedure or operator instead of an equation, in which case the equation f = 0 is plotted. Operator notation must be used, that is, the procedure name is given without parameters specified, and the ranges must be given simply in the form a..b and c..d, rather than as equations.
 • In the fourth calling sequence, implicitplot([expr1,expr2,t], x=a..b(x), y=c..d(x)), the expr1 and expr2 must be equations or expressions in the names x,y and t, and must be polynomial with respect to t. This form of call to implicitplot is equivalent to the call implicitplot(resultant(expr1,expr2,t), x=a..b(x), y=c..d(x)), except that the resultant is computed more efficiently avoiding expression growth and excessive round-off error.
 • Because the implicitplot command samples the function being plotted and builds the final image from the sample, it does not, by default, detect discontinuities in the function. Instead, the function is interpolated across the discontinuities. To change this behavior, see the rational and signchange options (described in the Options section).
 • For similar reasons, a sample based method cannot be used to detect isolated points which should be plotted.
 • If expr or f is a set or list (for the first two calling sequences), then its members are plotted together. If it is a list, then particular option values can also be given as lists, with elements corresponding to elements of expr or f. The options that can take lists as values are: color, coords, grid, legend, linestyle, numpoints, style, symbol, symbolsize, thickness, and transparency.

Notes

 • Note that implicitplot with the default settings does not do well for problems where the solution curve is very close to a region in which the expression being plotted becomes undefined or complex valued (for example expressions containing ln, where the argument can become negative). For problems of this class, the ideal approach is to increase the initial grid until points appear in the region, then increase gridrefine until the points describe a smooth curve.

Examples

 > $\mathrm{with}\left(\mathrm{plots},\mathrm{implicitplot}\right)$
 $\left[{\mathrm{implicitplot}}\right]$ (1)

Plot a circle.

 > $\mathrm{implicitplot}\left({x}^{2}+{y}^{2}=1,x=-1..1,y=-1..1\right)$

Use the operator form of the command.

 > p:= proc(x,y) if x
 > $\mathrm{implicitplot}\left(p,-2..2,-1..2,\mathrm{scaling}=\mathrm{constrained}\right)$

Use a different coordinate system.

 > $\mathrm{implicitplot}\left(r=1-\mathrm{cos}\left(\mathrm{θ}\right),r=0..2,\mathrm{θ}=0..2\mathrm{π},\mathrm{coords}=\mathrm{polar}\right)$

Use a set or a list to combine plots.

 > $\mathrm{implicitplot}\left(\left[{x}^{2}-{y}^{2}=1,y={ⅇ}^{x}\right],x=-\mathrm{π}..\mathrm{π},y=-\mathrm{π}..\mathrm{π},\mathrm{color}=\left["NavyBlue","Teal"\right],\mathrm{legend}=\left[\mathrm{plot1},\mathrm{plot2}\right]\right)$

Color the regions with blue and green.

 > $\mathrm{implicitplot}\left({x}^{2}+{y}^{2}-1,x=-1..1,y=-1..1,\mathrm{coloring}=\left["SteelBlue","DarkGreen"\right],\mathrm{filledregions}=\mathrm{true}\right)$

Implicit plot of 4 concentric circles - very rough

 > $\mathrm{fn}:=\left({x}^{2}+{y}^{2}-1\right)\left({x}^{2}+{y}^{2}-0.73\right)\left({x}^{2}+{y}^{2}-0.5\right)\left({x}^{2}+{y}^{2}-0.31\right):$
 > $\mathrm{implicitplot}\left(\mathrm{fn},x=-1.2..1.2,y=-1.2..1.2\right)$

Use of gridrefine=2 to get a finer grid (up to [101,101])

 > $\mathrm{implicitplot}\left(\mathrm{fn},x=-1.2..1.2,y=-1.2..1.2,\mathrm{gridrefine}=2\right)$

Use of crossingrefine=2 to more accurately determine crossings

 > $\mathrm{implicitplot}\left(\mathrm{fn},x=-1.2..1.2,y=-1.2..1.2,\mathrm{crossingrefine}=2\right)$

Comparison of size for high detail plots using resolution

 > $\mathrm{p1}:=\mathrm{implicitplot}\left(\mathrm{fn},x=-1.2..1.2,y=-1.2..1.2,\mathrm{gridrefine}=2,\mathrm{crossingrefine}=2\right):$
 > $\mathrm{p2}:=\mathrm{implicitplot}\left(\mathrm{fn},x=-1.2..1.2,y=-1.2..1.2,\mathrm{gridrefine}=2,\mathrm{crossingrefine}=2,\mathrm{resolution}=1000\right):$
 > $\mathrm{length}\left(\mathrm{p1}\right),\mathrm{length}\left(\mathrm{p2}\right)$
 ${14623}{,}{2399}$ (2)

Plot of a singular line using default linear interpolation

 > $\mathrm{implicitplot}\left(\frac{1}{x-y-0.01},x=0..1,y=0..1\right)$

Improvement using rational interpolation

 > $\mathrm{implicitplot}\left(\frac{1}{x-y-0.01},x=0..1,y=0..1,\mathrm{rational}\right)$

Intersection of a unit sphere and a cylinder projected into the x-y plane (two intersecting ellipses).

 > $\mathrm{implicitplot}\left(\left[{x}^{2}+{y}^{2}+{z}^{2}=1,\frac{{\left(x+\frac{z}{2}\right)}^{2}}{\frac{5}{4}}+{y}^{2}=\frac{1}{3},z\right],x=-1..1,y=-1..1,\mathrm{gridrefine}=3,\mathrm{scaling}=\mathrm{constrained}\right)$

Plotting of a curve that is strictly >=0

 > $\mathrm{implicitplot}\left({x}^{4}+2{x}^{2}{y}^{2}-2{x}^{2}+{y}^{4}-2{y}^{2}+1,x=-1.2..1.2,y=-1.2..1.2,\mathrm{factor}\right)$

Plotting of the region where x^2+y^2<1 (note the dotted border)

 > $\mathrm{implicitplot}\left({x}^{2}+{y}^{2}<1,x=-1.2..1.2,y=-1.2..1.2,\mathrm{filledregions}\right)$

Plotting a function where the vertical range is restricted by the horizontal variable

 > $\mathrm{implicitplot}\left(y-{x}^{2},x=0..2,y=0..x\right)$

A polar plot with outlines to indicate sampling grid

 > $\mathrm{plots}[\mathrm{implicitplot}]\left(2\mathrm{π}r-t,r=0..1,t=0..2\mathrm{π},\mathrm{coords}=\mathrm{polar},\mathrm{axes}=\mathrm{boxed},\mathrm{outlines},\mathrm{grid}=\left[5,5\right],\mathrm{gridrefine}=2,\mathrm{style}=\mathrm{point},\mathrm{axiscoordinates}=\mathrm{polar}\right)$

The command to create the plot from the Plotting Guide is

 > $\mathrm{implicitplot}\left({x}^{2}-{y}^{2}=1,x=-\mathrm{π}..\mathrm{π},y=-\mathrm{π}..\mathrm{π}\right)$