{ "cells": [ { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import plotly\n", "import plotly.graph_objs as go\n", "\n", "plotly.offline.init_notebook_mode(connected=True)\n", "\n", "plotly.offline.iplot({\n", " \"data\": [go.Scatter(x=[1, 2, 3, 4], y=[4, 3, 2, 1])],\n", " \"layout\": go.Layout(title=\"hello world\")\n", "})" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import plotly\n", "plotly.__version__" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import plotly.plotly as py\n", "import plotly.graph_objs as go\n", "# Configure Plotly to be rendered inline in the notebook.\n", "plotly.offline.init_notebook_mode(connected=True)\n", "# Create random data with numpy\n", "import numpy as np\n", "\n", "N = 1000\n", "random_x = np.random.randn(N)\n", "random_y = np.random.randn(N)\n", "\n", "# Create a trace\n", "trace = go.Scatter(\n", " x = random_x,\n", " y = random_y,\n", " mode = 'markers'\n", ")\n", "\n", "data = [trace]\n", "\n", "plot_figure = go.Figure(data=data)\n", "plotly.offline.iplot(plot_figure)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import plotly\n", "import plotly.plotly as py\n", "import plotly.graph_objs as go\n", "\n", "# Configure Plotly to be rendered inline in the notebook.\n", "plotly.offline.init_notebook_mode()\n", "\n", "z1 = [\n", " [8.83,8.89,8.81,8.87,8.9,8.87],\n", " [8.89,8.94,8.85,8.94,8.96,8.92],\n", " [8.84,8.9,8.82,8.92,8.93,8.91],\n", " [8.79,8.85,8.79,8.9,8.94,8.92],\n", " [8.79,8.88,8.81,8.9,8.95,8.92],\n", " [8.8,8.82,8.78,8.91,8.94,8.92],\n", " [8.75,8.78,8.77,8.91,8.95,8.92],\n", " [8.8,8.8,8.77,8.91,8.95,8.94],\n", " [8.74,8.81,8.76,8.93,8.98,8.99],\n", " [8.89,8.99,8.92,9.1,9.13,9.11],\n", " [8.97,8.97,8.91,9.09,9.11,9.11],\n", " [9.04,9.08,9.05,9.25,9.28,9.27],\n", " [9,9.01,9,9.2,9.23,9.2],\n", " [8.99,8.99,8.98,9.18,9.2,9.19],\n", " [8.93,8.97,8.97,9.18,9.2,9.18]\n", "]\n", "\n", "z2 = [[zij+1 for zij in zi] for zi in z1]\n", "z3 = [[zij-1 for zij in zi] for zi in z1]\n", "\n", "data = [\n", " go.Surface(z=z1),\n", " go.Surface(z=z2, showscale=False, opacity=0.9),\n", " go.Surface(z=z3, showscale=False, opacity=0.9)\n", "\n", "]\n", "plot_figure = go.Figure(data=data, layout=layout)\n", "plotly.offline.iplot(plot_figure)\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.6.7" } }, "nbformat": 4, "nbformat_minor": 2 }