#!/usr/bin/env python # coding: utf-8 # # Surface # In[1]: import k3d import numpy as np Nx = 240 Ny = 480 xmin, xmax = -3, 3 ymin, ymax = -0, 3 x = np.linspace(xmin, xmax, Nx) y = np.linspace(ymin, ymax, Ny) x, y = np.meshgrid(x, y) heights = np.sin(x**2 + y**2).astype(np.float32) plot = k3d.plot() obj = k3d.surface(heights, xmin=xmin, xmax=xmax, ymin=ymin, ymax=ymax) plot += obj plot.display() # In[2]: plot.camera = [2.93, -1.98, 4.33, 0, 1.5, 0, -0.37, 0.53, 0.76] # In[3]: plot.objects[0].flat_shading = False # In[4]: obj.attribute = heights obj.color_range = [np.min(heights), np.max(heights)] # In[5]: get_ipython().run_line_magic('pinfo2', 'k3d.surface') # In[ ]: