Complex values

With option 'draw_realpart', it is possible to tell Maxima
whether to plot or not complex values.

By default, the value of draw_realpart is 'true', which means
that complex numbers are transformated into their real parts
before plotting. When 'false', complex numbers are ignored and
are not plotted.

Option 'draw_realpart' has been introduced in Maxima 5.26.

Although these examples were made with functions 'wxdraw?d', they
also work with 'draw?d'.

explicit 2D

 (%i2) wxdraw2d(     /* default value */     explicit(sqrt(x^2-4*x)-x, x, -1, 5),     /* set value to false */     color = red,     draw_realpart = false,     explicit(sqrt(x^2-4*x)-x+2, x, -1, 5) )\$

explicit 3D

 (%i3) wxdraw3d(     /* default value */     enhanced3d = x,     explicit(sqrt(x+y),x,-1,1,y,-1,1),     /* set value to false */     color = red,     draw_realpart = false,     enhanced3d = y,     explicit(sqrt(x+y)+1,x,-1,1,y,-1,1) )\$

parametric 2D

 (%i4) wxdraw2d(     /* default value */     parametric(u,sqrt(u^2-4*u)-u, u, -1, 5),     /* set value to false */     color = red,     draw_realpart = false,     parametric(u,sqrt(u^2-4*u)-u+1, u, -1, 5) )\$

parametric 3D

 (%i5) wxdraw3d(     /* default value */     parametric(sqrt(u),u,sqrt(u^2-4*u)-u,u,-1,5),     /* set value to false */     nticks = 100,     color = red,     draw_realpart = false,     parametric(sqrt(u),u,sqrt(u^2-4*u)-u+5,u,-1,5) )\$

parametric_surface 3D

 (%i6) wxdraw3d(     xu_grid = 50,     yv_grid = 50,     /* default value */     enhanced3d = u,     parametric_surface(sin(u),cos(v),sqrt(u+v),u,-1,1,v,-1,1),     /* set value to false */     draw_realpart = false,     enhanced3d = v,     parametric_surface(1/2+sin(u),1/2+cos(v),sqrt(u+v),u,-1,1,v,-1,1) )\$

Created with wxMaxima.