import numpy as np
from numpy.random import rand
from numpy import exp as e, linspace as l, meshgrid as m
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
R=20*(rand(10,2)-.5)
def surf_z(x,y):
return sum([e(-abs(x-a))+e(-abs(y-b)) for a, b in R])
x = l(0,10)
X,Y=m(x,x)
Z=surf_z(X,Y)
sS=10*rand(1000,2)
sZ=surf_z(sS[::,0],sS[::,1])
fig = plt.figure()
ax = fig.add_subplot(111,projection='3d')
ax.plot_trisurf(sS[::,0], sS[::,1],sZ)
ax.plot_wireframe(X,Y,Z,color='r')
plt.show()
On this page of the site you can watch the video online Three minute coding - tesselated 3D surface Python Matplotlib with a duration of hours minute second in good quality, which was uploaded by the user Jake Waas (Required Citation) 04 January 2017, share the link with friends and acquaintances, this video has already been watched 901 times on youtube and it was liked by 3 viewers. Enjoy your viewing!