PLOTS trisurfΒΆ

# -*-Python-*-
# Created by bgrierson at 21 Dec 2016  05:22

# Make some 2D data
nx = 101
nt = 51
x = linspace(0, 1, nx)
t = linspace(0, 2, nt)
tt, xx = meshgrid(t, x)
f = np.sin(2.0 * np.pi * xx) * np.sin(2.0 * np.pi * tt)

# Make an interactive 3D plot
fig = figure()
ax3d = fig.use_subplot(111, projection='3d')
ax3d.plot_trisurf(xx.flatten(), tt.flatten(), f.flatten(), shade=False, cmap=mpl.cm.rainbow, linewidth=0.05)
ax3d.set_xlabel('x')
ax3d.set_ylabel('t')
ax3d.set_zlabel('f')