{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": { "execution": { "iopub.execute_input": "2024-03-26T14:37:55.022500Z", "iopub.status.busy": "2024-03-26T14:37:55.022422Z", "iopub.status.idle": "2024-03-26T14:37:55.338393Z", "shell.execute_reply": "2024-03-26T14:37:55.338105Z" } }, "outputs": [ { "data": { "text/html": [ "\n", "
\n", " \n", " " ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "import numpy as np\n", "from lets_plot import *\n", "\n", "LetsPlot.setup_html()" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "execution": { "iopub.execute_input": "2024-03-26T14:37:55.352388Z", "iopub.status.busy": "2024-03-26T14:37:55.352237Z", "iopub.status.idle": "2024-03-26T14:37:55.354674Z", "shell.execute_reply": "2024-03-26T14:37:55.354482Z" } }, "outputs": [], "source": [ "# This example was found at: https://jakevdp.github.io/PythonDataScienceHandbook/04.04-density-and-contour-plots.html\n", "def f(x, y):\n", " return np.sin(x) ** 10 + np.cos(10 + y * x) * np.cos(x)\n", "\n", "x = np.arange(0, 5, 6./50)\n", "y = np.arange(0, 5, 6./40)\n", "X, Y = np.meshgrid(x, y)\n", "Z = f(X, Y)" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "execution": { "iopub.execute_input": "2024-03-26T14:37:55.355850Z", "iopub.status.busy": "2024-03-26T14:37:55.355701Z", "iopub.status.idle": "2024-03-26T14:37:55.357131Z", "shell.execute_reply": "2024-03-26T14:37:55.356957Z" } }, "outputs": [], "source": [ "data = dict(\n", " x = X.reshape(-1),\n", " y = Y.reshape(-1),\n", " z = Z.reshape(-1)\n", ")" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "execution": { "iopub.execute_input": "2024-03-26T14:37:55.358266Z", "iopub.status.busy": "2024-03-26T14:37:55.358148Z", "iopub.status.idle": "2024-03-26T14:37:55.395624Z", "shell.execute_reply": "2024-03-26T14:37:55.395427Z" } }, "outputs": [ { "data": { "text/html": [ " \n", " " ], "text/plain": [ "