Esempio n. 1
0
def surf_demo(**kwargs):
   from ifigure.interactive import surf, threed

   threed('on')
   X = np.linspace(-5, 5, 40)
   Y = np.linspace(-5, 5, 40)
   X, Y = np.meshgrid(X, Y)
   R = np.sqrt(X**2 + Y**2)
   Z = np.sin(R)    
   surf(X,Y,Z, cmap='coolwarm', shade=True, **kwargs)
Esempio n. 2
0
def surf_demo(**kwargs):
    from ifigure.interactive import surf, threed

    threed('on')
    X = np.linspace(-5, 5, 40)
    Y = np.linspace(-5, 5, 40)
    X, Y = np.meshgrid(X, Y)
    R = np.sqrt(X**2 + Y**2)
    Z = np.sin(R)
    surf(X, Y, Z, cmap='coolwarm', shade=True, **kwargs)
Esempio n. 3
0
def surf_demo(**kwargs):
    from ifigure.interactive import surf, threed, figure, hold, lighting

    figure()
    threed('on')
    #   X = np.arange(-5, 5, 0.25)
    #   Y = np.arange(-5, 5, 0.25)
    X = np.linspace(-5, 5, 40)
    Y = np.linspace(-5, 5, 40)
    X, Y = np.meshgrid(X, Y)
    R = np.sqrt(X**2 + Y**2)
    Z = np.sin(R)

    lighting(light=0.5, ambient=0.7)
    surf(X, Y, Z, cmap='coolwarm', shade='linear', **kwargs)
Esempio n. 4
0
def surf_demo(**kwargs):
   from ifigure.interactive import surf, threed, figure, hold, lighting

   figure()
   threed('on')
#   X = np.arange(-5, 5, 0.25)
#   Y = np.arange(-5, 5, 0.25)
   X = np.linspace(-5, 5, 40)
   Y = np.linspace(-5, 5, 40)
   X, Y = np.meshgrid(X, Y)
   R = np.sqrt(X**2 + Y**2)
   Z = np.sin(R)

   lighting(light = 0.5, ambient = 0.7)   
   surf(X, Y, Z, cmap='coolwarm', shade = 'linear', **kwargs)
Esempio n. 5
0
def surf_demo2(**kwargs):
    from mpl_toolkits.mplot3d import Axes3D
    import numpy as np

    from ifigure.interactive import surf, threed, figure, isec, nsec

    figure(gl=True)
    nsec(3)
    isec(0)
    threed('on')
    u = np.linspace(0, 2 * np.pi, 100)
    v = np.linspace(0, np.pi, 100)

    x = 10 * np.outer(np.cos(u), np.sin(v))
    y = 10 * np.outer(np.sin(u), np.sin(v))
    z = 10 * np.outer(np.ones(np.size(u)), np.cos(v))
    surf(x, y, z, cz=False, facecolor='b', edgecolor='k')

    isec(1)
    threed('on')
    surf(x, y, z, cstride=4, cz=True, edgecolor='k')

    isec(2)
    threed('on')
    surf(x, y, z, cz=True, cdata=y, edgecolor=None)
Esempio n. 6
0
def surf_demo2(**kwargs):   
   from mpl_toolkits.mplot3d import Axes3D
   import numpy as np

   from ifigure.interactive import surf, threed, figure, isec, nsec

   figure(gl = True)
   nsec(3)
   isec(0)
   threed('on')
   u = np.linspace(0, 2 * np.pi, 100)
   v = np.linspace(0, np.pi, 100)

   x = 10 * np.outer(np.cos(u), np.sin(v))
   y = 10 * np.outer(np.sin(u), np.sin(v))
   z = 10 * np.outer(np.ones(np.size(u)), np.cos(v))
   surf(x, y, z, cz = False, facecolor='b', edgecolor = 'k')
   
   isec(1)
   threed('on')
   surf(x, y, z, cstride=4, cz = True,  edgecolor = 'k')

   isec(2)
   threed('on')
   surf(x, y, z,  cz = True, cdata = y, edgecolor = None)