parameters: (expr, ext_grid, Nx=11, Ny=11, Nz=11,
                   col_isurf=(50/255, 199/255, 152/255))
docstring: Function to plot algebraic surfaces described by implicit equations in Mayavi
   
      Implicit functions are functions of the form
   
          `F(x,y,z) = c`
   
      where `c` is an arbitrary constant.
   
      Parameters
      ----------
      expr : string
          The expression `F(x,y,z) - c`; e.g. to plot a unit sphere,
          the `expr` will be `x**2 + y**2 + z**2 - 1`
      ext_grid : 6-tuple
          Tuple denoting the range of `x`, `y` and `z` for grid; it has the
          form - (xmin, xmax, ymin, ymax, zmin, zmax)
      fig_handle : figure handle (optional)
          If a mayavi figure object is passed, then the surface shall be added
          to the scene in the given figure. Then, it is the responsibility of
          the calling function to call mlab.show().
      Nx, Ny, Nz : Integers (optional, preferably odd integers)
          Number of points along each axis. It is recommended to use odd numbers
          to ensure the calculation of the function at the origin.
docstring_summary: Function to plot algebraic surfaces described by implicit equations in Mayavi
   
      Implicit functions are functions of the form
   
          `F(x,y,z) = c`
   
      where `c` is an arbitrary constant.
   
      Parameters
      ----------
      expr : string
          The expression `F(x,y,z) - c`; e.g. to plot a unit sphere,
          the `expr` will be `x**2 + y**2 + z**2 - 1`
      ext_grid : 6-tuple
          Tuple denoting the range of `x`, `y` and `z` for grid; it has the
          form - (xmin, xmax, ymin, ymax, zmin, zmax)
      fig_handle : figure handle (optional)
          If a mayavi figure object is passed, then the surface shall be added
          to the scene in the given figure. Then, it is the responsibility of
          the calling function to call mlab.show().
      Nx, Ny, Nz : Integers (optional, preferably odd integers)
          Number of points along each axis. It is recommended to use odd numbers
          to ensure the calculation of the function at the origin.
docstring_tokens: Function to plot algebraic surfaces described by implicit equations in Mayavi Implicit functions are functions of the form F ( x y z ) = c where c is an arbitrary constant . Parameters ---------- expr : string The expression F ( x y z ) - c ; e . g . to plot a unit sphere the expr will be x ** 2 + y ** 2 + z ** 2 - 1 ext_grid : 6 - tuple Tuple denoting the range of x y and z for grid ; it has the form - ( xmin xmax ymin ymax zmin zmax ) fig_handle : figure handle ( optional ) If a mayavi figure object is passed then the surface shall be added to the scene in the given figure . Then it is the responsibility of the calling function to call mlab . show () . Nx Ny Nz : Integers ( optional preferably odd integers ) Number of points along each axis . It is recommended to use odd numbers to ensure the calculation of the function at the origin .
function: def implicit_plot(expr, ext_grid, Nx=11, Ny=11, Nz=11,
                   col_isurf=(50/255, 199/255, 152/255)):
      """
      Function to plot algebraic surfaces described by implicit equations in Mayavi
   
      Implicit functions are functions of the form
   
          `F(x,y,z) = c`
   
      where `c` is an arbitrary constant.
   
      Parameters
      ----------
      expr : string
          The expression `F(x,y,z) - c`; e.g. to plot a unit sphere,
          the `expr` will be `x**2 + y**2 + z**2 - 1`
      ext_grid : 6-tuple
          Tuple denoting the range of `x`, `y` and `z` for grid; it has the
          form - (xmin, xmax, ymin, ymax, zmin, zmax)
      fig_handle : figure handle (optional)
          If a mayavi figure object is passed, then the surface shall be added
          to the scene in the given figure. Then, it is the responsibility of
          the calling function to call mlab.show().
      Nx, Ny, Nz : Integers (optional, preferably odd integers)
          Number of points along each axis. It is recommended to use odd numbers
          to ensure the calculation of the function at the origin.
      """
      xl, xr, yl, yr, zl, zr = ext_grid
      x, y, z = np.mgrid[xl:xr:eval('{}j'.format(Nx)),
                         yl:yr:eval('{}j'.format(Ny)),
                         zl:zr:eval('{}j'.format(Nz))]
      scalars = eval(expr)
      src = mym.pipeline.scalar_field(x, y, z, scalars)
      cont1 = mym.pipeline.iso_surface(src, color=col_isurf, contours=[0],
                                        transparent=False, opacity=0.8)
      cont1.compute_normals = False # for some reasons, setting this to true actually cause
                                    # more unevenness on the surface, instead of more smooth
      cont1.actor.property.specular = 0.2 #0.4 #0.8
      cont1.actor.property.specular_power = 55.0
function_tokens: def implicit_plot ( expr , ext_grid , Nx = 11 , Ny = 11 , Nz = 11 , col_isurf = ( 50 / 255 , 199 / 255 , 152 / 255 ) ) : xl , xr , yl , yr , zl , zr = ext_grid x , y , z = np . mgrid [ xl : xr : eval ( '{}j' . format ( Nx ) ) , yl : yr : eval ( '{}j' . format ( Ny ) ) , zl : zr : eval ( '{}j' . format ( Nz ) ) ] scalars = eval ( expr ) src = mym . pipeline . scalar_field ( x , y , z , scalars ) cont1 = mym . pipeline . iso_surface ( src , color = col_isurf , contours = [ 0 ] , transparent = False , opacity = 0.8 ) cont1 . compute_normals = False # for some reasons, setting this to true actually cause # more unevenness on the surface, instead of more smooth cont1 . actor . property . specular = 0.2 #0.4 #0.8 cont1 . actor . property . specular_power = 55.0