{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "URL: http://matplotlib.org/examples/mplot3d/surface3d_demo.html\n", "\n", "Most examples work across multiple plotting backends, this example is also available for:\n", "\n", "* [Plotly - 3d surface](../plotly/surface_3d.ipynb)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import numpy as np\n", "import holoviews as hv\n", "hv.extension('matplotlib')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Define data" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# Make data.\n", "X = np.arange(-5, 5, 0.25)\n", "Y = np.arange(-5, 5, 0.25)\n", "X, Y = np.meshgrid(X, Y)\n", "R = np.sqrt(X**2 + Y**2)\n", "Z = np.sin(R)\n", "\n", "surface = hv.Surface(Z, bounds=(-5, -5, 5, 5))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Plot" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "surface.opts(colorbar=True)" ] } ], "metadata": { "language_info": { "name": "python", "pygments_lexer": "ipython3" } }, "nbformat": 4, "nbformat_minor": 2 }