Surface 3d

3D surface (color map)

URL: http://matplotlib.org/examples/mplot3d/surface3d_demo.html

Most examples work across multiple plotting backends, this example is also available for:

HoloViews

In [1]:
import numpy as np
import holoviews as hv
hv.extension('plotly')
The plotly backend is experimental, and is not supported at this time. If you would like to volunteer to help maintain this backend by adding documentation, responding to user issues, keeping the backend up to date as other code changes, or by adding support for other elements, please email holoviews@gmail.com

Define data

In [2]:
# Make data.
X = np.arange(-5, 5, 0.25)
Y = np.arange(-5, 5, 0.25)
X, Y = np.meshgrid(X, Y)
R = np.sqrt(X**2 + Y**2)
Z = np.sin(R)

surface = hv.Surface(Z, bounds=(-5, -5, 5, 5))

Plot

In [3]:
surface(plot=dict(colorbar=True, width=500, height=500))
Out[3]:
Drawing...

Download this notebook from GitHub (right-click to download).